Operating System - HP-UX
1819696 Members
3384 Online
109605 Solutions
New Discussion юеВ

size in ps and RSS in glance

 
Morten Kristiansen
Frequent Advisor

size in ps and RSS in glance

Hi,

I'm checking the memory use of two different processes. When I use ps -fel and look at the "size", it shows that process 100 is 17000 pages and process 200 is 8000 pages. My pagesize is 4K. But when I look at the processes in glance process 100 shows 40 MB and process 200 shows 210 MB.

How is this? Why are the memory size of the two processes so different?
6 REPLIES 6
Nicolas Dumeige
Esteemed Contributor

Re: size in ps and RSS in glance

Hello Morten,

For process 100 :
ps ] 17000 * 4k page = 68000 k = 66 MB
Glance ] 40 MB.

Not sure, but the difference could be the shared pages (shared librairies & executable text).

As for process 20... noop, no idea !

What OS realese are you using ?
Maybe you should look for the newest patchs.

Cheers

Nicolas
All different, all Unix
Bharat Katkar
Honored Contributor

Re: size in ps and RSS in glance

I think u should confirm again the following things:
1. Memory Page Size
2. Process 100's pages
3. Process 200's pages

This is something unbeleivable
You need to know a lot to actually know how little you know
Ralph Grothe
Honored Contributor

Re: size in ps and RSS in glance

Your assumption about the page size seems right.
However, since the ps command already also shows the RSS in KB, you need not do the arithmetic yourself.

Try for instance

UNIX95= ps -e -o comm,vsz

or if you need to find out how much a certain user consumes you could do this

# UNIX95= ps -u root -o comm= -o vsz=|awk '{s+=$2};END{printf"root procs use %8.2f MB memory\n",s/1024}'
root procs use 1033.17 MB memory
Madness, thy name is system administration
Morten Kristiansen
Frequent Advisor

Re: size in ps and RSS in glance

OK, thanks for all the answers and yes the page size is 4K and I'm running hp-ux 11.00.

17000 pages is approx. 68 MB, the same as I get when running UNIX95= ps -e -o comm,vsz. That is not the question or what's bother me.

What's bother me is that ps command shows that vsz is 68 MB, while Glance shows an RSS of 57 MB. Should it not be the same, or is there a difference between vsz and RSS?

And the other thing that's bothers me is that ps shows that prosess 100 is the process that uses most memory (vsz), while glance says it's process 200 (RSS).
Nicolas Dumeige
Esteemed Contributor

Re: size in ps and RSS in glance

RSS (resident set size) is the amount of memory mapped in RAM, per process. vsz is the virtual size. This is not the same information. The difference between the 2 process memory consuption can lies in the shared part.

All different, all Unix
Kiyoshi Miyake
Frequent Advisor

Re: size in ps and RSS in glance

Hi,

glance menu "M" (Process Memory Regions) shows RSS & VSS.

ps size shows VSS.

please check ps size & glance VSS.

Thanks.