睇Memory usage

#Sort ‘ps’ output by memory (RAM), from high to low

ps aux –sort -rss

#其實查一下 man ps 就可以看到說明了

man ps

D Uninterruptible sleep (usually IO)

R Running or runnable (on run queue)

S Interruptible sleep (waiting for an event to complete)

T Stopped, either by a job control signal or because it is being traced.

W paging (not valid since the 2.6.xx kernel)

X dead (should never be seen)

Z Defunct (“zombie") process, terminated but not reaped by its parent.

For BSD formats and when the stat keyword is used, additional characters may be displayed:

< high-priority (not nice to other users)

N low-priority (nice to other users)

L has pages locked into memory (for real-time and custom IO)

s is a session leader

l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)

+ is in the foreground process group

D 不能中斷的進程(通常為IO)

R 正在運行中的進程

S 已經中斷的進程,通常情況下,系統中大部分進程都是這個狀態

T 已經停止或者暫停的進程,如果我們正在運行一個命令,比如說sleep 10,如果我們按一下ctrl -z 讓他暫停,那麼我們用ps查看就會顯示T這個狀態

W 這個好像是說,從內核2.6xx 以後,表示為沒有足夠的內存頁分配

X 已經死掉的進程(這個好像從來不會出現)

Z 殭屍進程,殺​​不掉,打不死的垃圾進程,佔系統一小點資源,不過沒有關係。如果太多,就有問題了。一般不會出現。

下面一些是BSD風格的參數

< 高優先級進程

N 低優先級進程

L 在內存中被鎖了內存分頁

s 主進程

l 多線程進程

+ 代表在前台運行的進程