LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2006, 10:21 PM   #1
lunlun
Member
 
Registered: Jul 2005
Posts: 41

Rep: Reputation: 15
ps 101


Does anyone know how can i use the ps command to check which process is using up most of my memory.

I remember i could do it before but i just cant remember right now.


I remember I was able to use ps to show processes that is taking up say more than 10 Mb of memory.
 
Old 05-29-2006, 01:04 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Something like:

Code:
ps aux | grep -v '^USER' | awk '$5 > 10000 {print}' | sort -r -n -k 4
should do it. Or just fire up top and hit M (capital 'm') to have it sort the processes by memory usage.

Edit to add: There's also a -O (for order) flag to ps to sort by memory size so you don't necessarily have to call sort separately.

Last edited by btmiller; 05-29-2006 at 01:08 AM.
 
Old 05-29-2006, 04:20 AM   #3
lunlun
Member
 
Registered: Jul 2005
Posts: 41

Original Poster
Rep: Reputation: 15
Thx for the advise with awk.


awk is useful, yet its kind of annoying/hard to use for newcomers.


This is what i came up with after using btmiller's advise.

Code:
 

ps -eo "pid time comm sz" --sort vsz | awk '$4 > 50000 {print}'
thanks again~
 
  


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
ZyAIR B-101 dnelson Linux - Wireless Networking 5 04-06-2004 04:50 PM
Ram 101 brandonweinberg Linux - General 3 02-07-2004 08:15 PM
Wine 101 thebatgranny Linux - Software 8 10-13-2003 11:58 AM
Netwoking 101 Romulan Linux - Newbie 0 09-17-2003 05:54 PM
Samba 101 avatarpalin Mandriva 2 09-04-2003 07:51 PM


All times are GMT -5. The time now is 12:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration