<?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: UNIX app free memory in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96332#M6629</link>
    <description>&lt;P&gt;Yes, this is in scope for the next release of the unix app.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jun 2012 03:49:04 GMT</pubDate>
    <dc:creator>araitz</dc:creator>
    <dc:date>2012-06-16T03:49:04Z</dc:date>
    <item>
      <title>UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96324#M6621</link>
      <description>&lt;P&gt;It appears the UNIX 4.5 app does not take into account file system caching when reporting free memory.  For example, if I run etc/apps/unix/bin/vmstat.sh:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;-bash-3.2$ ./vmstat.sh 
memTotalMB   memFreeMB   memUsedMB  memFreePct  memUsedPct   pgPageOut  swapUsedPct   pgSwapOut   cSwitches  interrupts       forks   processes     threads  loadAvg1mi
     96165       50977       45187        53.0        47.0  2240619655          0.0           0  3534174241   855326036    56348253         286        3384        0.78
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk would tell me I have only 53% free memory on the server.  However, the free command reports a more accurate story:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;-bash-3.2$ free -m
             total       used       free     shared    buffers     cached Mem:         96165      45184      50980          0       1848      22945
-/+ buffers/cache:      20390      75774 Swap:         8189          0    8189
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So in reality I have 78% free memory if you consider the file system cache.  Has anyone else noticed this?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2012 13:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96324#M6621</guid>
      <dc:creator>sdlevi27</dc:creator>
      <dc:date>2012-03-19T13:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96325#M6622</link>
      <description>&lt;P&gt;I'm not sure that we want to consider the file system cache as part of your free memory.  I could be wrong though.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2012 17:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96325#M6622</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-03-19T17:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96326#M6623</link>
      <description>&lt;P&gt;I'm not talking about swap, I'm talking about the Linux file system buffer and cache.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2012 19:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96326#M6623</guid>
      <dc:creator>sdlevi27</dc:creator>
      <dc:date>2012-03-19T19:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96327#M6624</link>
      <description>&lt;P&gt;My fault, I edited my answer above.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2012 19:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96327#M6624</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-03-19T19:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96328#M6625</link>
      <description>&lt;P&gt;It would be very beneficial for the *NIX App to include free RAM+buffers+cache in the output of vmstat.sh as it more accurately reflects the amount of (mapped) memory available for applications to use instead of only free RAM (unmapped memory).&lt;/P&gt;

&lt;P&gt;Free memory should be calculated (from vmstat -s) as the sum of "free memory", "buffer memory" and "swap cache" (OR: &lt;CODE&gt;free -k | awk 'NR==3 {print $4}'&lt;/CODE&gt;). Free RAM is almost always at or below 10% shortly after reboot and applications/daemons start up; that's the modus operandi for Linux memory management and isn't an entirely accurate reflection of free memory available for everything except the kernel itself.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2012 14:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96328#M6625</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2012-04-13T14:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96329#M6626</link>
      <description>&lt;P&gt;Noted, I will make sure this is considered for a future release.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2012 15:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96329#M6626</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-04-13T15:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96330#M6627</link>
      <description>&lt;P&gt;You can edit the *NIX script to get the desired result. Just adjust the following lines in $splunk_home/etc/apps/unix/bin/vmstat.sh. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DERIVE='END {memUsedMB=memTotalMB-memFreeMB;
to 
DERIVE='END {memUsedMB=memTotalMB-memFreeMB-memBuffMB-memCacheMB;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PARSE_1='/total memory$/ {memTotalMB=$1/1024} /free memory$/ {memFreeMB=$1/1024}'
to
PARSE_1='/total memory$/ {memTotalMB=$1/1024} /free memory$/ {memFreeMB=$1/1024} /buffer memory$/ {memBuffMB=$1/1024} /swap cache$/ {memCacheMB=$1/1024}'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 May 2012 00:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96330#M6627</guid>
      <dc:creator>bhill99</dc:creator>
      <dc:date>2012-05-11T00:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96331#M6628</link>
      <description>&lt;P&gt;Is any workable solution for this?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2012 01:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96331#M6628</guid>
      <dc:creator>rajiv_kumar</dc:creator>
      <dc:date>2012-06-16T01:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96332#M6629</link>
      <description>&lt;P&gt;Yes, this is in scope for the next release of the unix app.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2012 03:49:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96332#M6629</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-06-16T03:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96333#M6630</link>
      <description>&lt;P&gt;Current NIX version is 4.5. When will be next version release?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2012 04:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96333#M6630</guid>
      <dc:creator>rajiv_kumar</dc:creator>
      <dc:date>2012-06-17T04:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96334#M6631</link>
      <description>&lt;P&gt;Awesome answer!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2012 03:39:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96334#M6631</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-07-06T03:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96335#M6632</link>
      <description>&lt;P&gt;To wrap this up, for SPL-52295 the final fix was implemented as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PARSE_1='/total memory$/ {memTotalMB=$1/1024} /free memory$/ {memFreeMB+=$1/1024} /buffer memory$/ {memFreeMB+=$1/1024} /swap cache$/ {memFreeMB+=$1/1024}'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The next version of the unix app, due out later this year, will contain this fix.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2012 18:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/96335#M6632</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-07-09T18:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX app free memory</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/510347#M62574</link>
      <description>&lt;P&gt;You can edit the *NIX script to add memCacheMB and memCachePct. Just adjust the following lines in $splunk_home/etc/apps/Splunk_TA_nix/bin/vmstat.sh.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HEADER='memTotalMB   memFreeMB   memUsedMB  memCacheMB  memFreePct  memUsedPct  memCachePct  pgPageOut  swapUsedPct   pgSwapOut   cSwitches  interrupts       forks   processes     threads  loadAvg1mi  waitThreads    interrupts_PS    pgPageIn_PS    pgPageOut_PS'
HEADERIZE="BEGIN {print \"$HEADER\"}"
PRINTF='END {printf "%10d  %10d  %10d  %10d  %10.1f  %10.1f  %10.1f  %10s   %10.1f  %10s  %10s  %10s  %10s  %10s  %10s  %10.2f  %10.2f    %10.2f    %10.2f    %10.2f\n", memTotalMB, memFreeMB, memUsedMB, memCacheMB, memFreePct, memUsedPct, memCachePct, pgPageOut, swapUsedP
ct, pgSwapOut, cSwitches, interrupts, forks, processes, threads, loadAvg1mi, waitThreads, interrupts_PS, pgPageIn_PS, pgPageOut_PS}'
DERIVE='END {memFreeMB+=memCacheMB; memUsedMB=memTotalMB-memFreeMB; memUsedPct=(100.0*memUsedMB)/memTotalMB; memFreePct=100.0-memUsedPct; memCachePct=(100.0*memCacheMB)/memTotalMB; swapUsedPct=swapUsed ? (100.0*swapUsed)/(swapUsed+swapFree) : 0;  waitThreads=loadAvg1mi &amp;gt; 
cpuCount ? loadAvg1mi-cpuCount : 0}'&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PARSE_1='/total memory$/ {memTotalMB=$1/1024} /free memory$/ {memFreeMB+=$1/1024} /buffer memory$/ {memFreeMB+=$1/1024} /swap cache$/ {memCacheMB=$1/1024}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can get outputs like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# ./vmstat.sh 
memTotalMB   memFreeMB   memUsedMB  memCacheMB  memFreePct  memUsedPct  memCachePct  pgPageOut  swapUsedPct   pgSwapOut   cSwitches  interrupts       forks   processes     threads  loadAvg1mi  waitThreads    interrupts_PS    pgPageIn_PS    pgPageOut_PS
      2832        2165         667        1388        76.4        23.6        49.0     2331754          0.5        3064     6377829     6892068      160152         367         546        0.09        0.00        247.50          0.00          0.00
[root@bogon bin]# &lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 06:26:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/UNIX-app-free-memory/m-p/510347#M62574</guid>
      <dc:creator>hujl</dc:creator>
      <dc:date>2020-07-22T06:26:00Z</dc:date>
    </item>
  </channel>
</rss>

