Check mem use of Process

jpfrancai
jpfrancai used Ask the Experts™
on
quick question this should be an easy on for you guys.
I need to check the top 15 process that are taking the most memory on my system.

If i do a top and sort by RSS i get this:

last pid: 24451;  load averages:  0.18,  0.20,  0.18                   16:39:29
109 processes: 107 sleeping, 1 zombie, 1 on cpu
CPU states: 98.5% idle,  0.5% user,  0.6% kernel,  0.4% iowait,  0.0% swap
Memory: 4096M real, 1905M free, 1440M swap in use, 6115M swap free

clePID USERNAME LWP PRI NICE  SIZE   RSS STATE      TIME   CPU% COMMAND

13665 oracle     1  50   20 1037M 1017M sleep 666:02.80  0.00% oracle
24140 oracle     1  21   20 1037M 1017M sleep   0:10.69  0.37% oracle
23715 oracle    11  38   20 1035M 1016M sleep   1:42.03  0.20% oracle
14050 oracle     1   0   20 1031M 1011M sleep 672:44.81  0.00% oracle
18979 oracle    11  58   20 1020M  999M sleep   0:01.26  0.00% oracle
12926 oracle     1  58   20 1016M  997M sleep   0:06.57  0.00% oracle
12930 oracle     1  58   20 1016M  997M sleep   0:11.09  0.00% oracle
12932 oracle     1  58   20 1016M  997M sleep   0:04.99  0.00% oracle
12928 oracle     1  58   20 1016M  997M sleep   0:10.31  0.00% oracle
12988 oracle     1  31   20 1016M  995M sleep  51:30.18  0.00% oracle
11738 oracle     1  40   20 1016M  995M sleep  22:19.71  0.00% oracle
 6272 oracle     1  52   20 1015M  994M sleep   0:03.90  0.00% oracle
18860 oracle     1  58   20 1015M  994M sleep   0:00.34  0.00% oracle
24142 oracle     1  58   20 1015M  994M sleep   0:00.23  0.00% oracle
12952 oracle     1  58   20 1015M  993M sleep   0:01.57  0.00% oracle
18290 oracle     1  54   20 1015M  993M sleep   2:38.33  0.00% oracle

Now if i do a a pmap on PID 13665 i get:

13665:  oracleFELIXP (DESCRIPTION=(LOCAL=no)(ADDRESS=(PROTOCOL=BEQ)))
Address   Kbytes Resident Shared Private
--- removed from message only showing top and bottom lines ---
total Kb 1060760 1046664   16704 1029960


I have a lot of process that show they take up 1034M or 900M of memory however that doesn't add up, if i only have 4000MB (4GB) in total Memory.

How can i get more realistic numbers that actually sum up.

here is a VMstat printout:

ora@flx1:/opt/RICHPse/toptool> vmstat 5 10
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s0 s1 s6 sd   in   sy   cs us sy id
 0 0 0 6458840 2252648 16 151 62 0 0  0  0  1  0  0  0  735  697  548  3  2 96
 0 0 0 6299504 1986800 0  1  0  0  0  0  0  6  0  0  0  688  246  202  1  0 99
 0 0 0 6298992 1986288 6 105 0  1  1  0  0  0  0  0  0  709  518  230  4  1 95
 0 0 0 6296528 1983968 4 86  0  0  0  0  0  0  0  0  0  681 1408  233  3  1 96


Thanks in advance.

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
The system is working with virtual memory.
Every process has atleast 4 Gb of processpace
but all of it is not mapped to physical memory.

You can se allocated and shared ( dynamic libs ) for
a process with pmap -x PID

There is also another gotcha involved here, in UNIXsystems
all processes has a parentprocess.
When a new proc is started it can be done with fork()
that creates a new proc with its own memory BUT
you can also use vfork() to share the parents memoryspace.

So it not quite that easy.

To really get into this stuff I can only recommend the book
Solaris Internals or Solaris Performance Tuning ( a bit old)

Another thing, dont worry about "free memory" it is designed to be as little as possible. Page stealing will
come into place when memory is needed.

To tune db and other servers, take a look at www.sun.com/blueprints  which has a lot of whitepapers.

HTH

Author

Commented:
hmm so is there a way to find out the exact information that i am looking for?

Commented:
Yes and no ( great answer )

Bad news, there is nothing in standard solaris to achive what you want.

Good news: visit the www.solarisinternals.com page
Here you can download memtool, procmem and a lot of other stuff for performance and systemmgmt

HTH

Commented:
Hello jpfrancai,

If you don't mind the question...

I'm running some stress tests with Oracle.  I'm attempting to commit 2,000 records/sec and the system is just keeping up, but I noticed my oracle processes are only consuming 3-5% CPU.  Total, 'top' only shows ~30% CPU utilization.

Do you have any thoughts?

Thanks...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial