<?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: Need to Calculate used memory in KB for monitoring script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184456#M460462</link>
    <description>Hi again&lt;BR /&gt;&lt;BR /&gt;I want to thank you all for your posts.&lt;BR /&gt;&lt;BR /&gt;I found some few commands which offer total and free memory, very handy if you need this information with no kmeminfo available:&lt;BR /&gt;&lt;BR /&gt;TOTAL MEMORY:&lt;BR /&gt;# echo phys_mem_pages/2d | adb /stand/vmunix /dev/kmem&lt;BR /&gt;&lt;BR /&gt;FREE MEMORY:&lt;BR /&gt;# echo freemem/2d | adb /stand/vmunix /dev/kmem&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
    <pubDate>Tue, 30 Jun 2009 15:07:45 GMT</pubDate>
    <dc:creator>Mahesh Alexander</dc:creator>
    <dc:date>2009-06-30T15:07:45Z</dc:date>
    <item>
      <title>Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184445#M460451</link>
      <description>Good Morning,&lt;BR /&gt;&lt;BR /&gt;We're using a script where we need to extract the exact amount of memory in KB the system is using at that moment.&lt;BR /&gt;&lt;BR /&gt;The closest we've been is with the vmstat command where we can obtain the number of pages used, which are 4KB each, then we multiply this amount and get the total amount of memory used, we think.. We're not quite sure about this as the amount given is sometimes above the total RAM of our Server. Maybe because it does use virtual pages from disc as well?&lt;BR /&gt;&lt;BR /&gt;Is there any other command where we can obtain this information easily? &lt;BR /&gt;&lt;BR /&gt;Commands like glance, top, etc are not useful as we need to obtain the information from a script.&lt;BR /&gt;&lt;BR /&gt;Any idea?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Tue, 30 Jun 2009 09:23:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184445#M460451</guid>
      <dc:creator>Mahesh Alexander</dc:creator>
      <dc:date>2009-06-30T09:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184446#M460452</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hpux.ws/?p=8" target="_blank"&gt;http://www.hpux.ws/?p=8&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That script shows top memory users. It is sorted.&lt;BR /&gt;&lt;BR /&gt;it accepts a command line parameter to tell how many processes to monitor.&lt;BR /&gt;&lt;BR /&gt;So it could be used to get snapshots of all resident memory on the system and do calculations as you desire.&lt;BR /&gt;&lt;BR /&gt;If you take it and modify it, I only ask that you return the results so I can post the modification to the blog.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 30 Jun 2009 09:38:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184446#M460452</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-06-30T09:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184447#M460453</link>
      <description>Thanks Steven for you quick response!&lt;BR /&gt;&lt;BR /&gt;Although your response is very useful I am afraid it was not exactly what we are looking for. &lt;BR /&gt;&lt;BR /&gt;The thing is we are using nagios for our servers monitoring. Nagios needs to request the information to our server sporadically and we don't want to run any script on the server itself. Our desire is to execute a command remotely and obtain the total amount of memory used at that moment for that server. We are using now vmstat and think we got the total amount by issuing vmstat and then multiply it by 4 (4KB each page of memory), but we want to know if this is the total amount of RAM and virtual memory used by the system. Are we wrong with this statement?&lt;BR /&gt;&lt;BR /&gt;Thank you!!</description>
      <pubDate>Tue, 30 Jun 2009 10:02:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184447#M460453</guid>
      <dc:creator>Mahesh Alexander</dc:creator>
      <dc:date>2009-06-30T10:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184448#M460454</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Instead of assuming the the pagesize is always 4K (it isn't necessarily) you should query it and use its value as your multiplier:&lt;BR /&gt;&lt;BR /&gt;# getconf PAGE_SIZE&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 30 Jun 2009 10:41:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184448#M460454</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-30T10:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184449#M460455</link>
      <description>Hi James, thanks for the command.&lt;BR /&gt;&lt;BR /&gt;Yes, the result after issuing the getconf command is:&lt;BR /&gt;&lt;BR /&gt;#getconf PAGE_SIZE&lt;BR /&gt;4096&lt;BR /&gt;&lt;BR /&gt;So, assuming this we can obtain the exact amount of memory the system is utilizing with the vmstat command. Is there a way to obtain only the RAM Mem usage at a given moment?&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Tue, 30 Jun 2009 10:51:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184449#M460455</guid>
      <dc:creator>Mahesh Alexander</dc:creator>
      <dc:date>2009-06-30T10:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184450#M460456</link>
      <description>Shalom again,&lt;BR /&gt;&lt;BR /&gt;Page size is 4K&lt;BR /&gt;&lt;BR /&gt;To calculate memory use in kb, divide page figures from vmstat or other page utilities by 4.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 30 Jun 2009 10:54:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184450#M460456</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-06-30T10:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184451#M460457</link>
      <description>Hi Mahesh,&lt;BR /&gt;&lt;BR /&gt;vmstat will not show the physical memory usage. It reports the virtual memory usage.&lt;BR /&gt;&lt;BR /&gt;If you want to know the physical memory usage then you may consider the HP tools like "kmeminfo". &lt;BR /&gt;&lt;BR /&gt;kmeminfo will give output like this..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;Physical memory usage summary (in page/byte/percent):&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Warning: Bad super pointer deref mem_class_t--&amp;gt;priv_data&lt;BR /&gt;&lt;BR /&gt;Warning: Bad super pointer deref u_mem_class_priv_t--&amp;gt;mrg_file_data&lt;BR /&gt;Physical memory       =   524288    2.0g 100%&lt;BR /&gt;Free memory           =   299134    1.1g  57%&lt;BR /&gt;User processes        =    40564  158.5m   8%  details with -user&lt;BR /&gt;System                =   181778  710.1m  35%&lt;BR /&gt;&lt;BR /&gt;You can grep only the "Free memory"&lt;BR /&gt;&lt;BR /&gt;Hope this helps</description>
      <pubDate>Tue, 30 Jun 2009 10:55:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184451#M460457</guid>
      <dc:creator>Ganesan R</dc:creator>
      <dc:date>2009-06-30T10:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184452#M460458</link>
      <description>&lt;BR /&gt;Hi Ganesan, that is exactly what I want but unfortunately kmeminfo was not found in our systems. We use V11.23. An easy way to get this command to function?? :) We are getting close with this one.&lt;BR /&gt;&lt;BR /&gt;p.s: want to thank you all for your quick support with this thread.</description>
      <pubDate>Tue, 30 Jun 2009 11:03:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184452#M460458</guid>
      <dc:creator>Mahesh Alexander</dc:creator>
      <dc:date>2009-06-30T11:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184453#M460459</link>
      <description>Using kmeminfo for this is like using a UDBC-II connector to check your oil level.&lt;BR /&gt;&lt;BR /&gt;vmstat reports virtual pages, but the free pages is physical. You can use it _if_ you know the total RAM in the first place (there are various tricks to get this such as adb, grepping the syslog for the boot up message, etc.). The best way to get both though is to write you own little pstat based program to report just what you want however you find it most useful for your script.&lt;BR /&gt;&lt;BR /&gt;Attaching a sample -- you'll likely want to just comment out/remove all you're not interested in (I expect the "physical" output is all you want).</description>
      <pubDate>Tue, 30 Jun 2009 11:13:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184453#M460459</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2009-06-30T11:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184454#M460460</link>
      <description>Hi Mahesh,&lt;BR /&gt;&lt;BR /&gt;kmeminfo in not an internal command. If you have contract you can get it from HP.</description>
      <pubDate>Tue, 30 Jun 2009 11:21:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184454#M460460</guid>
      <dc:creator>Ganesan R</dc:creator>
      <dc:date>2009-06-30T11:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184455#M460461</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Please assign some points who give there valuable time for your problem.&lt;BR /&gt;&lt;BR /&gt;To know how to assign points please go through the below link.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums13.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums13.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Tue, 30 Jun 2009 11:25:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184455#M460461</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-06-30T11:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184456#M460462</link>
      <description>Hi again&lt;BR /&gt;&lt;BR /&gt;I want to thank you all for your posts.&lt;BR /&gt;&lt;BR /&gt;I found some few commands which offer total and free memory, very handy if you need this information with no kmeminfo available:&lt;BR /&gt;&lt;BR /&gt;TOTAL MEMORY:&lt;BR /&gt;# echo phys_mem_pages/2d | adb /stand/vmunix /dev/kmem&lt;BR /&gt;&lt;BR /&gt;FREE MEMORY:&lt;BR /&gt;# echo freemem/2d | adb /stand/vmunix /dev/kmem&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 30 Jun 2009 15:07:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184456#M460462</guid>
      <dc:creator>Mahesh Alexander</dc:creator>
      <dc:date>2009-06-30T15:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184457#M460463</link>
      <description># echo freemem/2d | adb /stand/vmunix /dev/kmem</description>
      <pubDate>Tue, 30 Jun 2009 15:08:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184457#M460463</guid>
      <dc:creator>Mahesh Alexander</dc:creator>
      <dc:date>2009-06-30T15:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184458#M460464</link>
      <description>Just be aware that this is unsupported. No promises are made or implied that kernel global variables can't change between releases or even between patches. (This is why I recommended pstat -- that _is_ a supported interface).</description>
      <pubDate>Tue, 30 Jun 2009 15:53:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184458#M460464</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2009-06-30T15:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184459#M460465</link>
      <description>Hi :&lt;BR /&gt;&lt;BR /&gt;@ Don&lt;BR /&gt;&lt;BR /&gt;well, aside from the unsupported method the OP likes, he also assumes that the size of a page will always be 4K :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 30 Jun 2009 16:00:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184459#M460465</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-30T16:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Calculate used memory in KB for monitoring script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184460#M460466</link>
      <description>Hi again&lt;BR /&gt;&lt;BR /&gt;@ JRF,&lt;BR /&gt;No worries about that as we can whether choose between the supported method or not. And also we assume the final result depending on the size of PAGE_SIZE, so always we'll get the right result ;)&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Jul 2009 07:26:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-to-calculate-used-memory-in-kb-for-monitoring-script/m-p/5184460#M460466</guid>
      <dc:creator>Mahesh Alexander</dc:creator>
      <dc:date>2009-07-08T07:26:08Z</dc:date>
    </item>
  </channel>
</rss>

