Thursday, October 2, 2014

lesson 30: another way to view memory usage in linux

usually people will use 'top' command to view memory usage in linux, now i just found out another command that can do same thing.
ps aux --sort -rss

or you can sort by pid: (descending)
ps aux --sort -pid

if you want to sort by ascending you can remove "-" from the left of pid:
ps aux --sort pid

for more detailed view, you can use this command:
ps aux | less
i think it's like using the 'less' command to view a file, you can navigate it using page up/down, or arrow up/down button.

UPDATE: You can use this command to see the top 10 applications regarding RAM usage: 
ps -A --sort -rss -o comm,pmem | head -n 11
from this command, you get very simple view of processes that use your system RAM


No comments:

Post a Comment