LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to check Top memory consuming process In Gb (https://www.linuxquestions.org/questions/linux-server-73/how-to-check-top-memory-consuming-process-in-gb-4175411759/)

LittleMaster 06-16-2012 05:48 AM

How to check Top memory consuming process In Gb
 
Hello

Whether there is any tool are command avaiable to list all top running memory consuming process in Gb .I google and find top comman but it display the memory consumption IN Mb .How can i get the report in Gb format for beeter analysing

nick2day 06-16-2012 06:06 AM

Code:

ps aux | awk '{print $4"\t"$11}' | sort -gr | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr | head
Will sort it by percentage of total memory consumption.

If you're trying specifically to get the actual value in Megs/Gigs, you might want to install htop and give that a shot. htop has more options available.

http://htop.sourceforge.net/

LittleMaster 06-16-2012 06:27 AM

[root@example Desktop]# ps aux | awk '{print $4"\t"$11}' | sort -gr | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr | head
68.3 1 /usr/bin/java
2.1 1 gnome-screensaver
2.0 1 /usr/bin/Xorg
1.1 1 /usr/bin/gnome-terminal
0.9 1 /usr/libexec/mysqld
0.8 1 nautilus
0.5 1 /usr/lib/vmware-tools/sbin64/vmtoolsd
0.4 1 /usr/libexec/wnck-applet
0.4 1 metacity
0.4 1 gnome-panel
[root@example Desktop]# free -m
total used free shared buffers cached
Mem: 993 923 69 0 2 34
-/+ buffers/cache: 886 106
Swap: 8159 578 7581
[root@example Desktop]#

I could int find the wright percentage for the my server

unSpawn 06-16-2012 07:04 AM

How about using some memory-related switches and ps' sorting capabilities?:
Code:

/bin/ps ax -orss,%mem,cmd --sort=rss|tac|head -10

syg00 06-16-2012 07:20 AM

Seems the OP wants to correlate individual process "memory" usage (whatever that might mean) and overall system usage as per "free".

Good luck in that endeavour ...

unSpawn 06-16-2012 09:34 AM

Quote:

Originally Posted by syg00 (Post 4704795)
Seems the OP wants to correlate individual process "memory" usage (whatever that might mean) and overall system usage as per "free".

Ah, OK.


Quote:

Originally Posted by syg00 (Post 4704795)
Good luck in that endeavour ...

Maybe a link to a document explaining why 1 + 1 != 2 wrt Memory Management under Linux?

syg00 06-16-2012 11:21 PM

I'll try - but memory management is such a can of worms.
Have a read of this from one of the kernel devs. Take note of the general comments rather than the specific patches being discussed - this is pretty old, but still valid even though most of the patches have been merged by now.

There are also plenty of threads discussing this here on LQ.

Short answer - use the solutions offered to get the largest consumers, but don't try to reverse map it back to the "system used". Just too hard, even for the kernel devs.

Edit: forgot to mention; have a look at /proc/meminfo to see how many "types" of memory allocation there are. Not all relevant in this discussion admittedly.


All times are GMT -5. The time now is 02:12 PM.