问题
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?
回答1:
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.
回答2:
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
.
来源:https://stackoverflow.com/questions/14041044/memory-usage-with-high-precision