Memory usage with high precision

a 夏天 提交于 2019-12-12 03:45:56

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!