linux - How to see top processes by actual memory usage? -


i have server 12g of memory. fragment of top shown below:

pid user      pr  ni  virt  res  shr s %cpu %mem    time+  command                                                                                                                                                                                                                                                       12979 frank  20   0  206m  21m  12m s   11  0.2  26667:24 krfb                                                                                                                                                                                                                                                           13 root      15  -5     0    0    0 s    1  0.0  36:25.04 ksoftirqd/3                                                                                                                                                                                                                                                    59 root      15  -5     0    0    0 s    0  0.0   4:53.00 ata/2                                                                                                                                                                                                                                                          2155 root      20   0  662m  37m 8364 s    0  0.3 338:10.25 xorg                                                                                                                                                                                                                                                           4560 frank  20   0  8672 1300  852 r    0  0.0   0:00.03 top                                                                                                                                                                                                                                                            12981 frank  20   0  987m  27m  15m s    0  0.2  45:10.82 amarok                                                                                                                                                                                                                                                         24908 frank  20   0 16648  708  548 s    0  0.0   2:08.84 wrapper                                                                                                                                                                                                                                                        1 root      20   0  8072  608  572 s    0  0.0   0:47.36 init                                                                                                                                                                                                                                                           2 root      15  -5     0    0    0 s    0  0.0   0:00.00 kthreadd 

the free -m shows following:

             total       used       free     shared    buffers     cached mem:         12038      11676        362          0        599       9745 -/+ buffers/cache:       1331      10706 swap:         2204        257       1946 

as understand correctly system has 362 mb of available memory. question how can find out process consuming of memory?

just info, system running 64bit opensuse 12.

first, repeat mantra little while: "unused memory wasted memory". linux kernel keeps around huge amounts of file metadata , files requested, until looks more important pushes data out. it's why can run:

find /home -type f -name '*.mp3' find /home -type f -name '*.aac' 

and have second find instance run @ ridiculous speed.

linux leaves little bit of memory 'free' handle spikes in memory usage without effort.

second, want find processes eating memory; in top use m command sort memory use. feel free ignore virt column, tells how virtual memory has been allocated, not how memory process using. res reports how memory resident, or in ram (as opposed swapped disk or never allocated in first place, despite being requested).

but, since res count e.g. /lib/libc.so.6 memory once every process, isn't awesome measure of how memory process using. shr column reports how memory shared other processes, there no guarantee process sharing -- sharable, no 1 else wants share.

the smem tool designed users better gage how memory should really blamed on each individual process. clever work figure out unique, shared, , proportionally tallies shared memory processes sharing it. smem may understand memory going better top will, top excellent first tool.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -