LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-16-2012, 05:48 AM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 06-16-2012, 06:06 AM   #2
nick2day
LQ Newbie
 
Registered: Jun 2012
Distribution: Arch Linux
Posts: 11

Rep: Reputation: Disabled
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/
 
Old 06-16-2012, 06:27 AM   #3
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
[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
 
Old 06-16-2012, 07:04 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
How about using some memory-related switches and ps' sorting capabilities?:
Code:
/bin/ps ax -orss,%mem,cmd --sort=rss|tac|head -10
 
Old 06-16-2012, 07:20 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,827

Rep: Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006
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 ...
 
Old 06-16-2012, 09:34 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Quote:
Originally Posted by syg00 View Post
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 View Post
Good luck in that endeavour ...
Maybe a link to a document explaining why 1 + 1 != 2 wrt Memory Management under Linux?
 
Old 06-16-2012, 11:21 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,827

Rep: Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006Reputation: 4006
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.

Last edited by syg00; 06-17-2012 at 12:55 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check memory usage on running process/applications rickylim Linux - General 17 05-08-2013 09:09 PM
Command to check process taking high cached memory rajaniyer123 Linux - General 1 02-05-2012 03:52 PM
How can I check the memory consume of kernel modules,some tools like top? snaily Linux - Newbie 0 01-16-2010 01:17 AM
How to check memory consumed by hidden/defunct/zombie process rajaniyer123 Solaris / OpenSolaris 11 05-27-2009 02:11 AM
To find the process that uses the most memory using top nano2 Linux - Server 2 06-12-2008 10:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration