Operating System - HP-UX
1834481 Members
3443 Online
110067 Solutions
New Discussion

Memory consumed by process

 
ESPINEL Pascal
Occasional Contributor

Memory consumed by process

Hi,

How can i find the exact amount of memory used by a process or a progamm.
In Glance, what is the difference between RSS and VSS in the detail process screen ?

thank's
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: Memory consumed by process

1. Use Glance.

2. Simply put, RSS is real or physical memory, VSS is virtual or real plus swap.

HTH,
Pete

Pete
harry d brown jr
Honored Contributor

Re: Memory consumed by process

In glance, I use the graphical one, you can get "help":




The size (in KB) of resident memory for the process. This consists of text, data, stack, as well as the process' portion of shared memory regions (such as, shared libraries, text segments, and shared data).


Resident memory (RSS) is calculated as

RSS = sum of private region pages +

(sum of shared region pages /

number of references)


The number of references is a count of the number of attachments to the memory region. Attachments, for shared regions, may come from several processes sharing the same memory, a single process with multiple attachments, or combinations of these.


This value is only updated when a process uses CPU. Thus, under memory pressure, this value may be higher than the actual amount of resident memory for processes which are idle.


On HP-UX 10.20, the kernel instrumentation doubles the reported size of private regions. To compensate for this, the total reported RSS for each process is halved.


On HP-UX 11.0 and beyond, this metric accurately reports the resident memory for the process.


Note, a value of "na" may be shown for the swapper process.


This metric is specific to a process. If this metric is reported for a kernel thread, the value for its associated process is given.



VSS:

This consists of the sum of the virtual set size of all private and shared memory regions used by this process. This metric is not affected by the reference count for those regions which are shared.


Note, a value of "na" may be shown for the swapper process.


This metric is specific to a process. If this metric is reported for a kernel thread, the value for its associated process is given.


live free or die
harry
Live Free or Die
James R. Ferguson
Acclaimed Contributor

Re: Memory consumed by process

Hi:

For finding the memory utilzation of a process you can also use 'top' and 'ps'. With 'top' look at the column headed "SIZE". With 'ps' look at 'sz'.

Note the 'ps -el' reports in 4kb page sizes.

Regards!

...JRF...
Todd Larchuk
Advisor

Re: Memory consumed by process

RSS: Think of this as the amount of RAM chip memory being used by the process at this moment.

VSS: Think of this as the actual size of the process, most of which is either code that sits in the original executable file until it is needed, at which time it is paged in, or data that has been temporairly paged out to the swap area.

So VSS = RSS + code not paged in at the moment + data temporairly paged out at this moment.
Roger Baptiste
Honored Contributor

Re: Memory consumed by process

Hi,

the very nature of memory/process management makes "exact" memory consumption difficult.
One of the way to get the accurate value is:

UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1

HTh
raj
Take it easy.