1847295 Members
2894 Online
110264 Solutions
New Discussion

Memory consumption

 
Biren
Occasional Contributor

Memory consumption

How do i find the memory consumed by a process or a group of process? I am looking for a command line

Thanks
Biren
6 REPLIES 6
Eileen Millen
Trusted Contributor

Re: Memory consumption

UNIX95= ps -e -o vsz=Kbytes -o pid,args=Command-Line | sort -rnk1
This command is entered all on one line.

Eileen
Roger Baptiste
Honored Contributor

Re: Memory consumption

Hi,

With some variation ;-)

UNIX95= ps -e -o ruser,vsz,pid,args | sort -rnk2 |more

HTH
raj
Take it easy.
Uday_S_Ankolekar
Honored Contributor

Re: Memory consumption

Hi,
Try this command
UNIX95= ps -e -o ruser,vsz,pid,pcpu,args | sort -rnk2 | more

Also try this command for cpu intensive process

UNIX95= ps -e -o "pcpu vsz ruser pid stime time state args" | sort -rn |head -10


-USA
Good Luck..
Uday_S_Ankolekar
Honored Contributor

Re: Memory consumption

Hi,

Please Note that there is space between UNIX95= and ps
Good Luck..
Biren
Occasional Contributor

Re: Memory consumption

Thanks all for the reply.
Here is the command i executed

$ UNIX95= ps -e -o vsz -opid,args | sort -rnk1 | grep oracleSC01
32960 17038 oracleSC01 (DESCRIPTION=LOCAL=no)
32832 14884 oracleSC01 (DESCRIPTION=LOCAL=no)

I am trying to interpret this results.
1st column is the memory used by the process. Which is 32960 and 32832 both is around 32 MB each. The process listed above is connection to Oracle (shadow process). That means each connection will take up 32 MB of memory!?!?

Also, i am monitoring memory usage using gpm (glance), for each new connection it is adding 2.2 MB only to User Mem!!

What am i missing here? Thanks again

Biren
Steven Gillard_2
Honored Contributor

Re: Memory consumption

The "vsz" in ps includes the text, stack and data segments of a process. Use glance to check the sizes of the individual memory regions of these processes and you will see that most of the 30Meg is coming from the text segment.

The text segment is shared by all Oracle processes, which means that these processes are not using 32Meg each as the ps output says. On my db system the vsz value for all processes adds up to about 1Gig more than the actual amount of virtual memory in use because of this.

I'm not sure of an easy way to simply look at the data segment size of the process. q4 would do it but usually its not important to go into this level of detail.

Regards,
Steve