How to display RAM usage per user using top command options
Hi! I've been trying to find an option to display the exact ram usage value of the user that has the highest. Top command only displays the whole process but I need a "per user" value. Please help :(
:) |
Quote:
Or this: (echo "user rss(KiB) vmem(KiB)"; for user in $(users | tr ' ' '\n' | sort -u); do echo $user $(ps -U $user --no-headers -o rss,vsz \ | awk '{rss+=$1; vmem+=$2} END{print rss" "vmem}') done | sort -k3 ) | column -t |
Do I type those directly in unix?
---------- Post added 05-15-14 at 11:49 PM ---------- Quote:
|
Quote:
|
Quote:
|
How will I see the RAM usage of other users also?
|
Quote:
users=`ps -eouser --sort user --noheader|uniq` Or subsititue the command string in place of the $users entry. An alternative string using less commands with less elegant output could be: ps -eouser,size --sort user --no-header|awk '!($1 in a){a[$1];print rec,sum;sum=""}{sum+=$2;rec=$1} END {print rec,sum}' The values are in KB. and represent the currently allocated and intented to be allocated memory not the virtual memory. However This is still not ideal as it will only provide a rough value. Cheers |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 03:20 AM. |