1830498 Members
2256 Online
110006 Solutions
New Discussion

ps -elf SZ column

 
james p. boyle
New Member

ps -elf SZ column

HPUX 11.11
ps -elf list a SZ value that is described as "The size of blocks of the core image of the process."

How big is a block in bytes?
If I know the answer, can I summ all the process blocks plus the free pages from vmstat and get my total 2GB of memory or something close for that instant in time?
4 REPLIES 4
Jeff Schussele
Honored Contributor

Re: ps -elf SZ column

Hi James,

4KB is the block size

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Navin Bhat_2
Trusted Contributor

Re: ps -elf SZ column

4096 bytes (4k) is the default block size unless you have chosen to change the kernel.

SZ is a UNIX95 standard part of ps.

The size in physical pages of the core image of the process, including text, data, and stack space.

No you cannot summ all these blocks mainly because these do not account for shared memory, memory mapped files etc.

Again if you could be more specific what you want to achieve it would be easier to suggest an approach for you.

A. Clay Stephenson
Acclaimed Contributor

Re: ps -elf SZ column

You would be better advised to assert the XPG4 ps behavior by setting the UNIX95 env. variable.

e.g.
UNIX95= ps -e -o vsz,pid,comm

vsz will always be in KB.

Memory calculations are extremely difficult because shared library code might be used by many processes. The same is true of shared memory segments.
If it ain't broke, I can fix that.
Navin Bhat_2
Trusted Contributor

Re: ps -elf SZ column

Couple of clarifications there 1st I presume that you meant page size not block size. Either way the default pages are 4k in size.

You can use sz,vsz after setting the UNIX95 variable to the open portability standard.

export UNIX95=XPG4

Again "sz" is the real and "vsz" is the virtual size of the core image (data,text and stack) this does not include memory mapped or shared memory regions and cannot be used to sum physical memory totals with vmstat free pages.

Use top/glance as a good starting tool to get per process memory layout information.