Main Menu

Search

LINUX: "ps" Command To List and Sort All Non Root User Processes By Total Memory Usage - In Descending Order PID's with Highest Total Memory Used At the Top (How To Doc)

Below "ps" command can be used to list and sort all non root user processes by total memory usage. Below command shows PID's with Highest total used Memory (in MB) owned by root user at the top and list goes down in descending order sorted by total memory usage.
ps -N -U root -wo rss=,user,comm= --sort -rss | while read -r rss comm ; do echo $((rss/1024))"MB -" $comm; done

Below is example output of above command.

# ps -N -U root -wo rss=,user,comm= --sort -rss | while read -r rss comm ; do echo $((rss/1024))"MB -" $comm; done | more
0MB -
5959MB - oracle ora_dbw0_db
2710MB - appuser java
1957MB - oracle ora_mman_db
1156MB - orauser mysqld
853MB - oracle ora_cjq0_db
488MB - appuser java
467MB - orauser ora_mmon_db
441MB - orauser ora_smon_db
354MB - orauser ora_ckpt_db

Products to which Article Applies

All Linux Operating Systems


tarun boyella


No comments:

Post a Comment