<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Powershell script consuming memory in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146079#M12907</link>
    <description>&lt;UL&gt;
&lt;LI&gt;What is it consuming all disk space with? &lt;/LI&gt;
&lt;LI&gt;What files are being generated? &lt;/LI&gt;
&lt;LI&gt;Where are the files ending up?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Are you using the TA-DomainController-2012R2 and SA-ModularInput-PowerShell?&lt;/P&gt;</description>
    <pubDate>Tue, 17 Feb 2015 20:17:15 GMT</pubDate>
    <dc:creator>malmoore</dc:creator>
    <dc:date>2015-02-17T20:17:15Z</dc:date>
    <item>
      <title>Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146075#M12903</link>
      <description>&lt;P&gt;Running 6.1.3 on a 2012 AD server which is running the runpowershell.cmd script that contains the following line:&lt;/P&gt;

&lt;P&gt;%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -executionPolicy RemoteSigned -command ". '%SPLUNK_HOME%\etc\apps\%SplunkApp%\bin\powershell\%1'"&lt;/P&gt;

&lt;P&gt;Looks like the %1 parameter being passed is ad-repl-stat.ps1.&lt;/P&gt;

&lt;P&gt;If left to its own devices, this will consume ALL RAM.&lt;/P&gt;

&lt;P&gt;Perusal of logs show nothing. &lt;/P&gt;

&lt;P&gt;Exact script running on 20 other identical AD boxes without the excessive disk usage.&lt;/P&gt;

&lt;P&gt;Anyone seen this type of behavior before? Any direction on where to look is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 17:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146075#M12903</guid>
      <dc:creator>Jeff_Lightly_Sp</dc:creator>
      <dc:date>2015-02-17T17:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146076#M12904</link>
      <description>&lt;P&gt;Added tag for the windows infrastructure app, which will make your question more visible.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 17:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146076#M12904</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2015-02-17T17:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146077#M12905</link>
      <description>&lt;P&gt;Thanks hair9000, makes sense!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 17:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146077#M12905</guid>
      <dc:creator>Jeff_Lightly_Sp</dc:creator>
      <dc:date>2015-02-17T17:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146078#M12906</link>
      <description>&lt;P&gt;What folder is consuming all of the space? You can use a technique like this to find out: &lt;A href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/03/05/use-powershell-to-explore-disk-utilization-on-your-computer.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2011/03/05/use-powershell-to-explore-disk-utilization-on-your-computer.aspx&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 17:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146078#M12906</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2015-02-17T17:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146079#M12907</link>
      <description>&lt;UL&gt;
&lt;LI&gt;What is it consuming all disk space with? &lt;/LI&gt;
&lt;LI&gt;What files are being generated? &lt;/LI&gt;
&lt;LI&gt;Where are the files ending up?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Are you using the TA-DomainController-2012R2 and SA-ModularInput-PowerShell?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 20:17:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146079#M12907</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2015-02-17T20:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146080#M12908</link>
      <description>&lt;P&gt;Still using TA-DomainController-NT6. Upgrading to the newer TA is on our to-do list.&lt;/P&gt;

&lt;P&gt;I was initially told this was consuming disk space but after using Process Explorer, it is actually &lt;STRONG&gt;MEMORY&lt;/STRONG&gt; being consumed. After the script runs for 5 minutes it will utilize nearly 3GB of Private Bytes and continue to grab more until the process is killed or the box becomes nearly unusable.&lt;/P&gt;

&lt;P&gt;Sorry for that confusion but thanks for the Powershell technique harir9000.&lt;/P&gt;

&lt;P&gt;I have changed the tags and title for this question.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 21:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146080#M12908</guid>
      <dc:creator>Jeff_Lightly_Sp</dc:creator>
      <dc:date>2015-02-17T21:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146081#M12909</link>
      <description>&lt;P&gt;that's "HAL9000" (the AI), with an "R" thrown in for disambiguation. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 21:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146081#M12909</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2015-02-17T21:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146082#M12910</link>
      <description>&lt;P&gt;Was wondering "What the heck does hair9000 mean?". So, now I am enlightened &lt;STRONG&gt;AND&lt;/STRONG&gt; off to my optometrist.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 21:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146082#M12910</guid>
      <dc:creator>Jeff_Lightly_Sp</dc:creator>
      <dc:date>2015-02-17T21:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146083#M12911</link>
      <description>&lt;P&gt;I don't think TA-DomainController-NT6 will work with 2012R2. But you say all your other 2012R2 servers run it just fine?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 23:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146083#M12911</guid>
      <dc:creator>malmoore</dc:creator>
      <dc:date>2015-02-17T23:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146084#M12912</link>
      <description>&lt;P&gt;Yes, I've got ~20 other ADs in the same Server Class that are all 2012R2. For now I'm just terminating the batch file. I still get AD data -  it just bypasses the 3 powershell scripts, ad-health.ps1,ad-repl-stat.ps1 and siteinfo.ps1. I'm guessing I can live with this until I upgrade the TA.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 13:39:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146084#M12912</guid>
      <dc:creator>Jeff_Lightly_Sp</dc:creator>
      <dc:date>2015-02-18T13:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146085#M12913</link>
      <description>&lt;P&gt;Technically it does function, just does not use the PowerShell modinput ^_^. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2015 16:07:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146085#M12913</guid>
      <dc:creator>jbernt_splunk</dc:creator>
      <dc:date>2015-02-18T16:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146086#M12914</link>
      <description>&lt;P&gt;It'd be nice to debug this to see precisely where the memory is being consumed. But I think the time would be better spent on upgrading to a supported configuration first as @malmoore pointed out, and then see if the problem recurs. For posterity, I'll point to some resources for doing debugging in PowerShell:&lt;/P&gt;

&lt;P&gt;If you have v4 or v5 (in preview as of this writing), you can debug remotely which &lt;EM&gt;ought&lt;/EM&gt; to let you attach to the running PowerShell instance that's consuming all of the RAM. I've never done it, and can't promise it would work great if the system is out of memory and not functioning well.&lt;BR /&gt;
 - &lt;A href="http://blogs.msdn.com/b/powershell/archive/2014/11/19/powershell-remote-script-debugging-in-the-ise.aspx"&gt;Remote debugging in the ISE&lt;/A&gt; (requires WMF v5 preview)&lt;BR /&gt;
 - &lt;A href="http://blogs.msdn.com/b/powershell/archive/2013/12/19/windows-powershell-remote-debugging.aspx"&gt;Remote debugging from PowerShell console&lt;/A&gt; (requires PowerShell v4 on both ends)&lt;/P&gt;

&lt;P&gt;For PowerShell v2 and up, which is going to cover practically everything, you can edit a script and set breakpoints, or otherwise start a script in debug mode and do various troubleshooting techniques:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://technet.microsoft.com/en-us/library/dd819480.aspx"&gt;How to Debug Scripts in Windows PowerShell ISE&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 20 Feb 2015 16:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146086#M12914</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2015-02-20T16:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell script consuming memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146087#M12915</link>
      <description>&lt;P&gt;I agree, HAL, I will do the upgrade as that needs done anyway. Thank you for the links, I'll keep those handy.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2015 17:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Powershell-script-consuming-memory/m-p/146087#M12915</guid>
      <dc:creator>Jeff_Lightly_Sp</dc:creator>
      <dc:date>2015-02-23T17:20:37Z</dc:date>
    </item>
  </channel>
</rss>

