LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-08-2006, 08:47 PM   #1
rickylim
Member
 
Registered: Jan 2006
Location: Malaysia
Distribution: RedHat & FreeBSD
Posts: 68

Rep: Reputation: 15
How to check memory usage on running process/applications


Dear all,

i have a red hat enterprise linux running in my server.

my default login is init 3 (without GUI).

However, everytime when i run #startx to start the gui the memory usage shoot up to almost 95%, and when i logout from the gui it will still remain high at 80%.

Previously i have checked, if reboot my pc in init 3 it only consume 10% of the memory usage.

My questions:-
1) what's the command that i can use to check the memory usage for each of the running process/application so that i can kill the process.

Please advice.

Many thanks.

rgds.
Lim
 
Old 05-08-2006, 09:20 PM   #2
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
In this case, i would suggest the top command.
 
Old 05-08-2006, 09:22 PM   #3
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Rep: Reputation: 31
Don't worry about the memory usage. That's what memory is for. It's normal for Linux to use your RAM like that. What do you have it for if you're not going to use it? To list applications with processes and memory run 'top' from the command line.
 
Old 05-08-2006, 09:24 PM   #4
rickylim
Member
 
Registered: Jan 2006
Location: Malaysia
Distribution: RedHat & FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
i've tried using top command.

but one page is not enough to show all the running processes.

i tried to scroll down, but couldn't get down.

please advice.
 
Old 05-08-2006, 09:25 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,764

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
Top. See the man pages for a complete discussion of options and displays.
 
Old 05-08-2006, 09:27 PM   #6
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Quote:
Originally Posted by rickylim
i've tried using top command.

but one page is not enough to show all the running processes.

i tried to scroll down, but couldn't get down.
Try: ps fauxwww
 
Old 05-08-2006, 09:44 PM   #7
rickylim
Member
 
Registered: Jan 2006
Location: Malaysia
Distribution: RedHat & FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
Dear all, thanks for your reply.

you guys are very helpful.

i am having a 512MB ram, and now the usage is 500MB and the server has not been running life yet. can't imagine if we start running it as mail server for 600 users account.

i've tried #ps fauxwww, yea it lists the processes and memory.

but i still can't find which process is actually taking such a huge memory usage.

please advice on what to do.

Many thanks

rgds.
Lilm
 
Old 05-08-2006, 09:45 PM   #8
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Try the top command again, as soon as top is running, press "m" to sort the processes by memory
 
Old 05-08-2006, 09:48 PM   #9
rickylim
Member
 
Registered: Jan 2006
Location: Malaysia
Distribution: RedHat & FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
Hi PK21,

i tried running #top

and type m once top is running, but it only hide and unhide the memory usage on the top.

please help.

thanks
 
Old 11-02-2009, 05:59 PM   #10
jitheshktv
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
Try 'M' (Upper case)
 
Old 11-02-2009, 06:05 PM   #11
murankar
Member
 
Registered: Jan 2008
Location: Cleveland Ohio
Distribution: Current CentOS 5.6
Posts: 117

Rep: Reputation: 20
there is a new top command out called htop. It is top but updated with more useful tools. give it shot and see if that shows what you need.
 
Old 11-02-2009, 07:46 PM   #12
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Guys, the 1st 9 posts are from 2006....
 
Old 11-03-2009, 04:20 PM   #13
murankar
Member
 
Registered: Jan 2008
Location: Cleveland Ohio
Distribution: Current CentOS 5.6
Posts: 117

Rep: Reputation: 20
my bad; although the new tool htop is good to know. Hope it helps other people.
 
Old 10-26-2011, 03:47 PM   #14
sakibsyl
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 2
Cool Single process using how much memory

Guys,
After long discussion with my friend I have found the command
top -b -n 1 | grep -i (process name)
10th column is the actual memory usage.
 
1 members found this post helpful.
Old 01-30-2012, 11:29 PM   #15
lbeachmike
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
Even simpler would be just -

top -U <username>

That will show all processes under a specific username.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to programmatically monitor a process memory usage? thanhvn Programming 14 02-20-2009 01:15 AM
how to show the memory usage per process ty263 Linux - General 3 09-12-2008 06:36 AM
how to programmatically monitor a process memory usage? thanhvn Linux - Software 1 11-15-2005 08:44 PM
about displaying process memory usage maginotjr Slackware 2 09-13-2005 11:43 AM
Process memory usage wombat53 Linux - Newbie 5 07-21-2005 07:42 PM


All times are GMT -5. The time now is 07:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration