【記憶體占用】
#利用ps命令,預設使用ps引數會顯示的結果ps -aux
user pid %cpu %mem vsz rss tty stat start time command
root 1 0.0 0.0 19352 1308 ? ss jul29 0:00 /sbin/init
root 2 0.0 0.0 0 0 ? s jul29 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? s jul29 0:11 [migration/0]
#從以上可以看出 第3列是cpu,第四列是記憶體
#所以整合排序命令就可以得出 記憶體占用最多的程序
ps -aux | sort -k4nr | head -n
#n為需要顯示的結果行數
# 利用top命令,點選m則可以按照mem排序
【cpu占用】
#利用ps命令ps -aux | sort -k3nr | head -n
#利用top命令,點選p則可以按照cpu排序
檢視linux記憶體占用
可以直接使用top命令後,檢視 mem的內容。可以選擇按程序檢視或者按使用者檢視,如想檢視oracle使用者的程序記憶體使用情況的話可以使用如下的命令 1 top top命令是linux下常用的效能分析工具,能夠實時顯示系統中各個程序的資源占用狀況,類似於windows的任務管理器 可以直接使用to...
Linux下檢視哪些程序占用的CPU 記憶體資源
1.cpu占用最多的前10個程序 ps auxw head 1 ps auxw sort rn k3 head 10 2.記憶體消耗最多的前10個程序 ps auxw head 1 ps auxw sort rn k4 head 10 3.虛擬記憶體使用最多的前10個程序 ps auxw head ...
Linux下檢視程序占用的CPU記憶體資源
linux下獲取占用cpu資源最多的10個程序,可以使用如下命令組合 ps aux head 1 ps aux grep v pid sort rn k 3 head 該命令組合實際上是下面兩句命令 ps aux head 1 ps aux grep v pid sort rn k 3 head 其...