LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-09-2008, 04:48 AM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
Memory usage


Hi,

The following happens in my server.

uptime
12:45:41 up 21 days, 4:40, 1 user, load average: 0.00, 0.00, 0.00

free
total used free shared buffers cached
Mem: 4037972 4007072 30900 0 28924 271976
-/+ buffers/cache: 3706172 331800
Swap: 4192888 184 4192704

How can i find out, which process is consuming the RAM memory? The load is low, but the memory is almost completely used.

Any suggestions?
 
Old 01-09-2008, 05:15 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
At first you can have a look at the resource monitor. From the command line I'd look at "top" and move the sorting column using the ">" and "<" keys. In this way you can sort by the RES or the %MEM field (usually %CPU is the default).

You can extract the same information using "ps", for example like this
Code:
ps -eo pid,user,rss,pcpu,pmem,comm --sort=-rss
 
Old 01-09-2008, 05:29 AM   #3
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
Colucix,
Great. It works.

< and > , Is there more options to view top results. If you can, Please provide a good link of it.

Thanks again
 
Old 01-09-2008, 05:36 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
"man top" - personally I prefer to use a config file; that way I get what I want everytime I start up top.
 
Old 01-09-2008, 05:42 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
See man top, in particular section "3. Interactive Commands" or look for some good article or tutorial, like this. Just out of curiosity, have you found the memory consuming process?
 
Old 01-09-2008, 05:46 AM   #6
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
Yes ,

It was the java , which is eating the RAM upto 85%

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
529 zamo 17 0 4947m 3.3g 69m S 0.0 85.9 0:15.18 java

Thank you Both
 
Old 01-16-2008, 06:30 AM   #7
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
Everyone,
In the above post, Java is consuming a lot of RAM. I used to restart the tomcat(java) to fix this issue. Is there anyway to fix this , without restarting the tomcat server.

Thanks in Advance.
 
  


Reply



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
X hangs after prolonged usage ... memory usage goes upto 195MB duryodhan Slackware 18 05-10-2007 06:16 PM
Memory Usage Spaw Usage Swappiness Issues joelunch Linux - Software 3 01-04-2006 06:16 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM

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

All times are GMT -5. The time now is 10:41 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