0

How can I get high precision memory usage per proccess with "ps aux"?

$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   3672  1984 ?        Ss   Dec11   0:07 /sbin/init
root         2  0.0  0.0      0     0 ?        S    Dec11   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    Dec11   0:23 [ksoftirqd/0]
root         6  0.0  0.0      0     0 ?        S    Dec11   0:00 [migration/0]
...

I need more than 1 digit after point. Maybe I can format column with %MEM?

mystdeim
  • 4,802
  • 11
  • 49
  • 77

2 Answers2

2

Look into the proc filesystem /proc/[pid]/status, /proc/[pid]/statm, /proc/[pid]/smaps.

To get fully detailed memory map /proc/[pid]/maps

Read the proc(5) manual page for all the details.

kmkaplan
  • 18,655
  • 4
  • 51
  • 65
  • For process 1234, look into `/proc/1234/`, for your own process, look into `/proc/self/` (e.g. `/proc/1234/maps` or `/proc/self/maps`) And `/proc/meminfo` tells about the entire system. – Basile Starynkevitch Dec 26 '12 at 17:03
0

the ps command have that. you can type man ps for detail.

when the termianl show info after you typed it, you can type /memory , then heighlight contain 'memory''s string. you can type n show next palace with memory.