Operating System - HP-UX
1831211 Members
2737 Online
110021 Solutions
New Discussion

Memory utilization - glance vs. ps

 
Bret S
Occasional Contributor

Memory utilization - glance vs. ps

Glance reports 80% of my 2GB RAM is utilized. However, when I run:
UNIX95= ps -eo vsz,user,comm,args

And add up all the vsz numbers, I come out to about 307 MB used. According to the man page, vsz is in kb, so I assume I'm using the right metrics.
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor

Re: Memory utilization - glance vs. ps

Hi Bret:

The 'ps' output for 'vsz' is in *pages*:

# getconf PAGESIZE
4096

...so there is the first metric needed to obtain memory in bytes.

Also, 'ps' does *not* consider memory-mapped files or shared memory in its reporting.

Regards!

...JRF....
Emil Velez
Honored Contributor

Re: Memory utilization - glance vs. ps



Glance and measureware are always correct. They use a kernel interface to read its data which is specific to HPUX or the other OSs it is ported to.

As was previously mentioned glance includes all pages of a process and shared libraries and shared memory is not counted in ps.