<?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: Memory usage per process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508078#M217775</link>
    <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;I am trying to use these commands to find out the usage of physical memory by different processors. But in my server when i am trying to run these two command to check for sshd process. One command is showing up the sshd is running and the other one is not at all showing the sshd process. Here i am attaching the output of the commands gathered from my server. Please let me know how to find out sshd process is using the Physical Memory of swap because here when i am running glance its showing up 99% usage of physical memory and 45% on swap. &lt;BR /&gt;&lt;BR /&gt;root# UNIX95= ps -eo 'vsz pid args' |sort -nr |head -20 | grep sshd&lt;BR /&gt;root#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;root# UNIX95= ps -e -o "user,pcpu,cpu,vsz,pid,ppid,args" | sort -rnk4 | grep sshd | more&lt;BR /&gt;root      0.06  0    1708 25528  4569 sshd: agarcia@pts/240&lt;BR /&gt;root      0.02  1    1708 28674  4569 sshd: djrobins@pts/578&lt;BR /&gt;root      0.02  0    1708 19089  4569 sshd: lanier@pts/394&lt;BR /&gt;root      0.02  0    1708 19038     1 sshd: root@pts/91&lt;BR /&gt;root      0.02  0    1708 18510  4569 sshd: root@pts/587&lt;BR /&gt;root      0.02  0    1708 17804  4569 sshd: root@pts/583&lt;BR /&gt;root      0.02  0    1708  5114  4569 sshd: jaleman1@pts/42&lt;BR /&gt;root      0.02  0    1708  3226  4569 sshd: dcrawfor@pts/95&lt;BR /&gt;root      0.14  0    1644  3430  4569 sshd: eparker@pts/208&lt;BR /&gt;root      0.02  0    1644 27640  4569 sshd: dtravers@pts/534&lt;BR /&gt;root      0.02  0    1644 23153  4569 sshd: rjanak@pts/485&lt;BR /&gt;root      0.02  0    1644 21086  4569 sshd: rplancar@pts/400&lt;BR /&gt;root      0.02  0    1644 20666  4569 sshd: kearley@notty&lt;BR /&gt;root      0.02  0    1644 18601  4569 sshd: flores@pts/233&lt;BR /&gt;root      0.02  0    1644 16969  4569 sshd: scedillo@pts/87&lt;BR /&gt;root      0.02  0    1644 11236  4569 sshd: concur@notty&lt;BR /&gt;root      0.50  0    1580 17952  4569 sshd: sahlert@pts/325&lt;BR /&gt;root      0.29  0    1580 23635  4569 sshd: sbales@pts/239&lt;BR /&gt;root      0.18  0    1580 23990  4569 sshd: jquillan@pts/189&lt;BR /&gt;root      0.17  0    1580 26601  4569 sshd: nac@pts/417&lt;BR /&gt;root      0.16  0    1580 10666  4569 sshd: mweeks@pts/318&lt;BR /&gt;root      0.12  0    1580 13314  4569 sshd: btrzebia@pts/430&lt;BR /&gt;root      0.11  0    1580  4641  4569 sshd: root@pts/8&lt;BR /&gt;root      0.10  0    1580 23392  4569 sshd: klostak@pts/89&lt;BR /&gt;root      0.09  0    1580 22326  4569 sshd: &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please clarify my doubt&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Venkat</description>
    <pubDate>Tue, 15 Nov 2005 12:03:51 GMT</pubDate>
    <dc:creator>Venkat_11</dc:creator>
    <dc:date>2005-11-15T12:03:51Z</dc:date>
    <item>
      <title>Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508075#M217772</link>
      <description>Hi, i know that the memory usage per process is treated previously in the forum, but I can't get correct values. The sum of processes does not even agree whith the Physical Memory or Shared Memory.&lt;BR /&gt;&lt;BR /&gt;I need to know how i can get the memory use per process (Only RAM) and that the add of all process memory is agree with the RAM memory or the Shared Memory. &lt;BR /&gt;&lt;BR /&gt;I can use procsize or ps.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Sat, 19 Mar 2005 13:20:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508075#M217772</guid>
      <dc:creator>Jimbo_7</dc:creator>
      <dc:date>2005-03-19T13:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508076#M217773</link>
      <description>Does this do it:&lt;BR /&gt;&lt;BR /&gt;# cat /usr/local/bin/processmem&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# processmem - display memory claimed by a process&lt;BR /&gt;# gwild 03192004&lt;BR /&gt;#&lt;BR /&gt;if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Usage:"&lt;BR /&gt;  echo "processmem \"process\""&lt;BR /&gt;  echo "Example:"&lt;BR /&gt;  echo "processmem rpc"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;echo " "&lt;BR /&gt;&lt;BR /&gt;PROCESS=$1&lt;BR /&gt;&lt;BR /&gt;mps=0&lt;BR /&gt;#for sz in `ps -elf | grep $PROCESS | grep -v grep | awk '{print $10}'`&lt;BR /&gt;for sz in `UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes | grep $PROCESS | awk '{print $1}'`&lt;BR /&gt;do&lt;BR /&gt;mps=`expr $mps + $sz`&lt;BR /&gt;done&lt;BR /&gt;#echo `expr $mps \* 4096`&lt;BR /&gt;echo "\nMemory claimed by $PROCESS: $mps Kbytes.\n"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Sat, 19 Mar 2005 19:53:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508076#M217773</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-03-19T19:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508077#M217774</link>
      <description>&lt;BR /&gt;Or use one of the following:&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -eo 'vsz pid args' |sort -nr |head -20&lt;BR /&gt;UNIX95= ps -e -o "user,pcpu,cpu,vsz,pid,ppid,args" | sort -rnk4&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;David de Beer.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2005 05:40:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508077#M217774</guid>
      <dc:creator>David de Beer</dc:creator>
      <dc:date>2005-03-22T05:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508078#M217775</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;I am trying to use these commands to find out the usage of physical memory by different processors. But in my server when i am trying to run these two command to check for sshd process. One command is showing up the sshd is running and the other one is not at all showing the sshd process. Here i am attaching the output of the commands gathered from my server. Please let me know how to find out sshd process is using the Physical Memory of swap because here when i am running glance its showing up 99% usage of physical memory and 45% on swap. &lt;BR /&gt;&lt;BR /&gt;root# UNIX95= ps -eo 'vsz pid args' |sort -nr |head -20 | grep sshd&lt;BR /&gt;root#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;root# UNIX95= ps -e -o "user,pcpu,cpu,vsz,pid,ppid,args" | sort -rnk4 | grep sshd | more&lt;BR /&gt;root      0.06  0    1708 25528  4569 sshd: agarcia@pts/240&lt;BR /&gt;root      0.02  1    1708 28674  4569 sshd: djrobins@pts/578&lt;BR /&gt;root      0.02  0    1708 19089  4569 sshd: lanier@pts/394&lt;BR /&gt;root      0.02  0    1708 19038     1 sshd: root@pts/91&lt;BR /&gt;root      0.02  0    1708 18510  4569 sshd: root@pts/587&lt;BR /&gt;root      0.02  0    1708 17804  4569 sshd: root@pts/583&lt;BR /&gt;root      0.02  0    1708  5114  4569 sshd: jaleman1@pts/42&lt;BR /&gt;root      0.02  0    1708  3226  4569 sshd: dcrawfor@pts/95&lt;BR /&gt;root      0.14  0    1644  3430  4569 sshd: eparker@pts/208&lt;BR /&gt;root      0.02  0    1644 27640  4569 sshd: dtravers@pts/534&lt;BR /&gt;root      0.02  0    1644 23153  4569 sshd: rjanak@pts/485&lt;BR /&gt;root      0.02  0    1644 21086  4569 sshd: rplancar@pts/400&lt;BR /&gt;root      0.02  0    1644 20666  4569 sshd: kearley@notty&lt;BR /&gt;root      0.02  0    1644 18601  4569 sshd: flores@pts/233&lt;BR /&gt;root      0.02  0    1644 16969  4569 sshd: scedillo@pts/87&lt;BR /&gt;root      0.02  0    1644 11236  4569 sshd: concur@notty&lt;BR /&gt;root      0.50  0    1580 17952  4569 sshd: sahlert@pts/325&lt;BR /&gt;root      0.29  0    1580 23635  4569 sshd: sbales@pts/239&lt;BR /&gt;root      0.18  0    1580 23990  4569 sshd: jquillan@pts/189&lt;BR /&gt;root      0.17  0    1580 26601  4569 sshd: nac@pts/417&lt;BR /&gt;root      0.16  0    1580 10666  4569 sshd: mweeks@pts/318&lt;BR /&gt;root      0.12  0    1580 13314  4569 sshd: btrzebia@pts/430&lt;BR /&gt;root      0.11  0    1580  4641  4569 sshd: root@pts/8&lt;BR /&gt;root      0.10  0    1580 23392  4569 sshd: klostak@pts/89&lt;BR /&gt;root      0.09  0    1580 22326  4569 sshd: &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please clarify my doubt&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Venkat</description>
      <pubDate>Tue, 15 Nov 2005 12:03:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508078#M217775</guid>
      <dc:creator>Venkat_11</dc:creator>
      <dc:date>2005-11-15T12:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508079#M217776</link>
      <description>It is very important to NOT use grep to locate processes by name. grep has no clue that you want it to match the exact process name and not match on a user name like sshdave or lasshd3. The secret is -C as in:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -C sshd -o ruser,pid,ppid,args&lt;BR /&gt; &lt;BR /&gt;As for tring to match memory usage, Unix has many, many memory maps and local process memory is just one. You have to add the buffer cache, the shared libraries, shared executables, memory mapped files, the kernel itself as well as shared memory between programs. It is quite difficult for a simple tool like ps to make sense of all this. For instance, a single program may have 20 copies but only one area of memory contains the instructions (called the text area in HP-UX terms), and that program may be one of dozens of programs that use a single shared library. This memory area cannot be added to a sinlge program's usage as it would not represent true memory usage.&lt;BR /&gt; &lt;BR /&gt;Similarly, a program may access a shared memory area that other programs use. These shared resources are essentially a kernel resource because multiple programs may use these shared areas. Another area is the buffer cache. All programs that read/write files will use the buffer cache.&lt;BR /&gt; &lt;BR /&gt;Your best bet is to look at the Glance stats for each interesting process (ones that consume a lot of memory). Look at the online help for Glance to explain the virtual versus resident set size (VSS, RSS).</description>
      <pubDate>Tue, 15 Nov 2005 19:46:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508079#M217776</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-11-15T19:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508080#M217777</link>
      <description>On an rp8400, with HP-UX 11.11, the suggested variants of ps such as &lt;BR /&gt;UNIX95= ps -eo 'vsz pid args'&lt;BR /&gt;appear to give virtual size or count shared memory multiply.  Adding the totals in one instance givs a total of 27+ GB on a machine with 8 GB of real memory.  (Unless the ps output is off by a factor of about 10:  The top output shows about 2.7 GB in use and 3.2 GB free.)&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -eo 'vsz sz pid args' |\&lt;BR /&gt; awk '{mem += $1; pgs += $2};END {printf "% 19d\n", pgs*4}' gives 28144708.</description>
      <pubDate>Tue, 19 Dec 2006 15:07:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508080#M217777</guid>
      <dc:creator>Thomas D. Dial</dc:creator>
      <dc:date>2006-12-19T15:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508081#M217778</link>
      <description>My objective is to determine the amount of non-shared memory each process uses.  &lt;BR /&gt;&lt;BR /&gt;On an rp8400, with HP-UX 11.11, the suggested variants of ps such as &lt;BR /&gt;UNIX95= ps -eo 'vsz pid args'&lt;BR /&gt;appear to give virtual size or count shared memory multiply.  Adding the totals in one instance givs a total of 27+ GB on a machine with 8 GB of real memory.  (Unless the ps output is off by a factor of about 10:  The top output shows about 2.7 GB in use and 3.2 GB free.)&lt;BR /&gt;&lt;BR /&gt;UNIX95= ps -eo 'vsz sz pid args' |\&lt;BR /&gt; awk '{mem += $1; pgs += $2};END {printf "% 19d\n", pgs*4}' gives 28144708.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Dec 2006 15:09:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508081#M217778</guid>
      <dc:creator>Thomas D. Dial</dc:creator>
      <dc:date>2006-12-19T15:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage per process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508082#M217779</link>
      <description>Well, your objective may not be include shared memory but that dog just ain't gonna hunt -- at least with command-line tools. Shared memory does not only mean IPCS shared memory segments but also shared text. For example, you may have 10 instances of vi running and while they each have separate and distinct data segments, they share a common text segment (the program code) as well as functions from shared libraries which might be in use by hundreds of processes. Trying to do the kind of calculations that you are doing is all but impossible with simple scripts.</description>
      <pubDate>Tue, 19 Dec 2006 15:42:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-usage-per-process/m-p/3508082#M217779</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-12-19T15:42:42Z</dc:date>
    </item>
  </channel>
</rss>

