Operating System - HP-UX
1833959 Members
2139 Online
110063 Solutions
New Discussion

Re: How to find the Incore memore size of a process

 
Chakravarthy_1
Occasional Advisor

How to find the Incore memore size of a process

Hi,

I thought that the following command would give the incore(Active regions) memory size of the process.

UNIX95= ps -efo pid,comm,vsz|sort -rnk 3|grep oracleQSTPRD

This gave the output for VSZ as 900MB. But when i killed the processes it released only 200M. is there any way to find out the currently active regions of a process(That is only the process size lying in the memory)

Regards,
Pathri.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: How to find the Incore memore size of a process

Hi:

The 'sz' (or 'vsz') field reported by 'ps' does not include any shared memory segments or shared libraries.

Using 'glance' will provide you a far superior view of a process's memory accounting.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: How to find the Incore memore size of a process

First be very careful killing process (especially with kill -9) because you may leave IPCS data structure like shared memory hanging. Second, the vsz value includes text (code) and data so that many processes might share common text and killing one process will free the private data but leave the text. Shared library code may be used my many, many processes and that too is included in vsz. Shared memory wouldn't be freed as well. In short, it is very unrealistic to expect to get all your space back because vsz includes many components that are share. In fact, if your sum vsz for all processes, it is quite possible that that value greatly exceeds the total virtual memory of the system because the shared components are counted more than once.
If it ain't broke, I can fix that.
Sundar_7
Honored Contributor

Re: How to find the Incore memore size of a process

Pathri,

Download and ftp the attached file to the system and unshar it.

This will give you the detailed output of the memory regions in use by the process.

Again, you can also get this information using glance.

Thanks,

Sundar.
Learn What to do ,How to do and more importantly When to do ?
Don Morris_1
Honored Contributor

Re: How to find the Incore memore size of a process

Your problem is actually quite simple. You're looking at the Virtual Size of the process (vsz), but checking physical memory resources returned. The two are usually very different, with virtual memory being popular for a while now and all. Report sz as well as vsz or instead of, that's the physical memory size.