<?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 memory leak - script to compare output in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565442#M372129</link>
    <description>&lt;!--!*#--&gt;I wrote a little script to compare the output of the below command to see if a certain process is using more memory. I was hoping some of the HP gurus here could give me some feedback.&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -e -o ruser,vsz,pid,args&lt;BR /&gt;&lt;BR /&gt;To use it, run the command and save the output to a file. After a while, run it again and save the output to another file. Run the script by passing the file names as paramaters (first-run first, then second run).&lt;BR /&gt;&lt;BR /&gt;./compare_ps.pl mem.one mem.two&lt;BR /&gt;&lt;BR /&gt;The columns are:&lt;BR /&gt;&lt;BR /&gt;- PID : PID of process&lt;BR /&gt;- DFFF : Numerical difference&lt;BR /&gt;- DIFF % : Difference in %&lt;BR /&gt;- ONE MEM: The memory used for the process on the first run&lt;BR /&gt;- ONE COMMAND: The process command&lt;BR /&gt;- TWO MEM: The memory used for the process on the second run&lt;BR /&gt;- TWO COMMAND: The process command&lt;BR /&gt;&lt;BR /&gt;I added the ONE COMMAND and TWO COMMAND columns to confirm it is the same process.&lt;BR /&gt;&lt;BR /&gt;The script will not show processes unless:&lt;BR /&gt;&lt;BR /&gt;- the PID exists on both runs&lt;BR /&gt;- memory usage for a process is not 0&lt;BR /&gt;- memory usage for a process is not the same on both runs&lt;BR /&gt;- the commands for a process on both runs is the same&lt;BR /&gt;- the % difference is not less then 1 (memory usage decresed)&lt;BR /&gt;&lt;BR /&gt;Any thoughts?</description>
    <pubDate>Sat, 16 Jan 2010 16:44:48 GMT</pubDate>
    <dc:creator>Anchal Nigam</dc:creator>
    <dc:date>2010-01-16T16:44:48Z</dc:date>
    <item>
      <title>memory leak - script to compare output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565442#M372129</link>
      <description>&lt;!--!*#--&gt;I wrote a little script to compare the output of the below command to see if a certain process is using more memory. I was hoping some of the HP gurus here could give me some feedback.&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -e -o ruser,vsz,pid,args&lt;BR /&gt;&lt;BR /&gt;To use it, run the command and save the output to a file. After a while, run it again and save the output to another file. Run the script by passing the file names as paramaters (first-run first, then second run).&lt;BR /&gt;&lt;BR /&gt;./compare_ps.pl mem.one mem.two&lt;BR /&gt;&lt;BR /&gt;The columns are:&lt;BR /&gt;&lt;BR /&gt;- PID : PID of process&lt;BR /&gt;- DFFF : Numerical difference&lt;BR /&gt;- DIFF % : Difference in %&lt;BR /&gt;- ONE MEM: The memory used for the process on the first run&lt;BR /&gt;- ONE COMMAND: The process command&lt;BR /&gt;- TWO MEM: The memory used for the process on the second run&lt;BR /&gt;- TWO COMMAND: The process command&lt;BR /&gt;&lt;BR /&gt;I added the ONE COMMAND and TWO COMMAND columns to confirm it is the same process.&lt;BR /&gt;&lt;BR /&gt;The script will not show processes unless:&lt;BR /&gt;&lt;BR /&gt;- the PID exists on both runs&lt;BR /&gt;- memory usage for a process is not 0&lt;BR /&gt;- memory usage for a process is not the same on both runs&lt;BR /&gt;- the commands for a process on both runs is the same&lt;BR /&gt;- the % difference is not less then 1 (memory usage decresed)&lt;BR /&gt;&lt;BR /&gt;Any thoughts?</description>
      <pubDate>Sat, 16 Jan 2010 16:44:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565442#M372129</guid>
      <dc:creator>Anchal Nigam</dc:creator>
      <dc:date>2010-01-16T16:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: memory leak - script to compare output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565443#M372130</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You don't offer what process (or kind of process) you are attempting to monitor; nor why.  Do you believe you have a problem?&lt;BR /&gt;&lt;BR /&gt;Focusing on process "data" as opposed to a process's stack or "text" (instructions), even if a process 'free()'s memory that it has 'malloc()'ed, that memory isn't returned to the operating system at large until the process terminates.  Rather, the 'free'ed memory is returned to the 'heap' where it is available again to 'malloc'.  By design, the goal is to minimize some of the overhead of memory allocation/deallocation.&lt;BR /&gt;&lt;BR /&gt;Thus, you generally won't see the memory of a running process shrinking over time.&lt;BR /&gt;&lt;BR /&gt;The maximum size of the heap is governed by the kernel fence 'maxdsiz' or 'maxdsiz_64bit' for 32-bit and 64-bit processes, respectively.&lt;BR /&gt;&lt;BR /&gt;You can examine some of a heap's characteristics with 'mallinfo()' [see the manpages for 'malloc'].&lt;BR /&gt;&lt;BR /&gt;Another problem with measuring a process'es memory footprint is the accounting of shared memory among various processes and/or shared libraries.  Do you accord shared components to every process sharing them or not count them at all?  Different tools may provide different views and values.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 16 Jan 2010 17:46:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565443#M372130</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-01-16T17:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: memory leak - script to compare output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565444#M372131</link>
      <description>@James R. Ferguson: I am not sure about any of that. I am relativly new to all this. My HP-UX 11.11 system is showing these errors in /var/adm/messages:&lt;BR /&gt;&lt;BR /&gt;sysmap_64bit: rmap ovflo, lost [3636915,3636917)&lt;BR /&gt;sysmap_64bit: rmap ovflo, lost [3636913,3636914)&lt;BR /&gt;&lt;BR /&gt;I was told the below command can be used to track down what process is responsible.&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -e -o ruser,vsz,pid,args&lt;BR /&gt;&lt;BR /&gt;??</description>
      <pubDate>Sat, 16 Jan 2010 17:53:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565444#M372131</guid>
      <dc:creator>Anchal Nigam</dc:creator>
      <dc:date>2010-01-16T17:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: memory leak - script to compare output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565445#M372132</link>
      <description>Hi (again) :&lt;BR /&gt;&lt;BR /&gt;See Don Morris's comments in this thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1045375" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1045375&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Read, too, the link he references, which points to the kernel tunable 'nsysmap'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Sat, 16 Jan 2010 19:14:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565445#M372132</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-01-16T19:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: memory leak - script to compare output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565446#M372133</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Well you almost got it, very close.&lt;BR /&gt;&lt;BR /&gt;UNIX95=1 ps -ef -o vsz,pcpu,pid,ppid,state,args | sort -rn | head -15 &amp;gt; $OUTFILE&lt;BR /&gt;&lt;BR /&gt;Run in cron every 15-20 minutes.  You are looking for stable and static of which 95% will be, or growing in vsz.  &lt;BR /&gt;&lt;BR /&gt;Let it run for 2-3 days.&lt;BR /&gt;</description>
      <pubDate>Sat, 16 Jan 2010 22:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565446#M372133</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2010-01-16T22:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: memory leak - script to compare output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565447#M372134</link>
      <description>If you really have an application memory leak in addition to that rmap ovflo kernel message, you can use wdb's heap checking commands.</description>
      <pubDate>Sun, 17 Jan 2010 01:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-script-to-compare-output/m-p/4565447#M372134</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-01-17T01:36:28Z</dc:date>
    </item>
  </channel>
</rss>

