- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Getting RSS memory using ps command in HP UX 11.31
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 02:29 AM
07-29-2014 02:29 AM
Getting RSS memory using ps command in HP UX 11.31
Hello all,
this is my first post, so I hope to be well received here :)
I am trying to get a weekly report on the use of memory and CPU of different processes. So far I am using the ps command and redirecting the output to a file like this:
UNIX95=1 ps -ef -o pcpu,pid,args | grep Dweblogic.Name=CitNave02 | grep -v grep >> /home/wlogic11/monitores_procesos/CitNave02_CPU
after that I process the file and I get the CPU of the process. However, I would also need the rss memory used by this process. I have checked the man of ps and found sz The size in physical pages of the core image of the process, including text, data, and stack space.
But when using that parameter:
UNIX95=1 ps -ef -o pcpu,sz,pid,args | grep Dweblogic.Name=CitNave02 | grep -v grep
5.82 56348 19872 /opt/java6/jre/bin/IA64W/java -Dweblogic.Name=CitNave02
I get 56348 pages, if I multiply that by 4K each page I obtain 225392Kb which is totally different from the output of the glance command for that process which is 1,59Gb :
Process Name PID Name ( 400% max) Cnt IOrate RSS/VSS On
java 19872 wlogic11 3.1 55 0.0 1.59gb 3.11gb SLEEP
How can I obtaing the RSS value using ps command? I have found several responses over the internet where it use the argument "rss" but it this parameter doesn't appear at the ps manual.
If there is no way to obtaing the RSS value using ps, any suggestion would be appreciated.
Thank you very much.
Kind regards.
David O.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 02:53 AM
07-29-2014 02:53 AM
Re: Getting RSS memory using ps command in HP-UX 11.31
>If there is no way to obtaining the RSS value using ps, any suggestion would be appreciated.
What does vsz give? A number 4 times smaller?
If you want RSS, perhaps you need to use pstat_getprocvm(2).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 03:46 AM
07-29-2014 03:46 AM
Re: Getting RSS memory using ps command in HP-UX 11.31
Hello Dennis,
if I use vsz in stead of sz I get approxymately the VSS
UNIX95=1 ps -ef -o pcpu,vsz,pid,args | grep Dweblogic.Name=CitNave02 | grep -v grep
2.71 3340484 19872 /opt/java6/jre/bin/IA64W/java
3340484/1024/1024= 3.18 Gb. At glance:
Process Name PID Name ( 400% max) Cnt IOrate RSS/VSS On
java 19872 wlogic11 1.3 55 0.0 1.89gb /3.14gb SLEEP
This value is not useful to me, because this weblogic has configurated 2Gb of memory and VSS shows more memory used than this value. VSS shows the memory used by the process itself but also the memory that it shares with other processes while RSS shows the "real" used memory only by that process.
So, another solution would be to calculate the RSS using the VSS, but I haven't found any way neither.
Thank you, regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 09:42 AM
07-29-2014 09:42 AM
Re: Getting RSS memory using ps command in HP UX 11.31
Hello David,
Welcome to the community!
A couple of suggestions:
1) There is also a "vsz" parameter so you might get better results with that parameter
2) You are multiplying the "sz" parameter by 4K, which makes sense since that is the default page size. However, the base pagesize is tunable via the "base_pagesize" kctune parameter. Are you certain your system is using a 4K pagesize?
Regards,
Dave
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2014 11:34 PM
07-29-2014 11:34 PM
Re: Getting RSS memory using ps command in HP UX 11.31
Hello Dave and thanks for the welcome,
I didn't realize that base_pagesize might be changed, but sadly I have checked and it is 4K so I don't understand why if I multiply the number of pages currently allocated in memory (parameter size of ps command) by 4K I am not getting the RSS parameter...
Regarding to the vsz, thank you but, as I said in my previous message, this parameter shows the total memory allocated by the process (its code, parameters, etc) but in vsz it shows also some memory that the process has currently allocated but shared with other processes. At the example that I put it is very clear, I have a Weblogic process which shouldn't been allocating more than 2Gb (because it is configured like that) and the VSZ parameter is showing 3Gb while the RSS memory is less than 2Gb.
Thank for your reply, kind regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2014 01:48 PM
07-30-2014 01:48 PM
Re: Getting RSS memory using ps command in HP-UX 11.31
If you search for pstat_getprocvm(2) you can find several topics with source to a program:
http://h30499.www3.hp.com/t5/System-Administration/Substitue-of-PMAP-in-11-23/m-p/5918583#M482792
http://h30499.www3.hp.com/t5/System-Administration/Memory-footprint-command/m-p/2966942#M119625