LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 09-17-2007, 03:52 PM   #1
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Rep: Reputation: 15
Memory Usage


Hi,

We have RHEL4 and application running on it.

I have been collecting the output of "free" command to keep an eye on the memory usage. I can see that there was a drastic change in the memory usage. See the ouput below it hsows the used memory drops from 11GB to 1.8GB. Why is that so?

Thu Sep 13 10:10:10 PDT 2007
total used free shared buffers cached
Mem: 12302400 11901760 400640 0 237668 4866208
-/+ buffers/cache: 6797884 5504516
Swap: 1769464 0 1769464
Thu Sep 13 10:20:10 PDT 2007
total used free shared buffers cached
Mem: 12302400 1816972 10485428 0 237344 887920
-/+ buffers/cache: 691708 11610692
Swap: 1769464 0 1769464

Thanks,
Ajatiti
 
Old 09-18-2007, 02:57 PM   #2
ChrisScott
Member
 
Registered: Nov 2006
Location: St Albans, England
Distribution: Fedora c3/5, Suse pro 10/openSuse 10.2, RHES, Zenwalk.....
Posts: 97

Rep: Reputation: 15
It might be useful to know which process are using your memory up!

Try something like:

Code:
ps --no-headers -eo size,cmd,pid |sort -n |tail -10
After using free to find the 10 biggest footprints....
 
Old 09-19-2007, 08:37 AM   #3
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Original Poster
Rep: Reputation: 15
Thank you ChrisScott,

After running that command I found there is a process taking highest memory of 711MB.

Still I have more Q - why does the size of used memory on the server get on increasing? If I sum up the memory used by all the processes in ps command, it doesn't equal to the used memory shown using free command.
Who is using the remaining memory? and why does it(total used memory) suddenly become very less?

Thanks,
Ajay
 
Old 09-19-2007, 05:03 PM   #4
ech310n
Member
 
Registered: Jan 2004
Distribution: RHEL, Fedora
Posts: 46

Rep: Reputation: 16
Hi,

We too have seen similar behaviour on RHEL4 systems. This seems to be down to the way linux uses available memory to speed up I/O by allocating it to cache. If you look, where you have a smaller amount of free RAM, you will notice the cache value has increased. This is normal behvaiour, and as RAM is needed to execute processes it is taken away from cache and realocated accordingly. Linux tries to make the best use it can of all available RAM. There was a big problem with this in RHEL3 Update 3 and below however where a kernel parameter /proc/sys/vm/pagecache) was set such that the system could potentially allocate 100% of RAM to cache, and thus start swapping out active processes which would eventually result in the system hanging, but I think the management of this is handled much better in RHEL4 with the 2.6 kernel.

Hope that helps.
 
Old 09-20-2007, 09:36 AM   #5
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Original Poster
Rep: Reputation: 15
Thanks ech310n,

So in this case:

Thu Sep 13 10:10:10 PDT 2007
total used free shared buffers cached
Mem: 12302400 11901760 400640 0 237668 4866208
-/+ buffers/cache: 6797884 5504516
Swap: 1769464 0 1769464

What is the actual memory used by the above Server?


Thanks,
Ajay
 
Old 09-25-2007, 10:06 AM   #6
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Original Poster
Rep: Reputation: 15
Any Ideas?
 
Old 10-07-2007, 06:44 AM   #7
rmitev
LQ Newbie
 
Registered: Sep 2007
Posts: 27

Rep: Reputation: 15
Code:
Thu Sep 13 10:10:10 PDT 2007
        total         used     free   shared   buffers   cached
Mem: 12302400     11901760   400640        0    237668  4866208
-/+ buffers/cache: 6797884  5504516
Swap: 1769464            0  1769464
free (+buff/cache) = 5504516
cached= 4866208

for more
Code:
cat /proc/meminfo
 
Old 10-07-2007, 06:51 AM   #8
rmitev
LQ Newbie
 
Registered: Sep 2007
Posts: 27

Rep: Reputation: 15
Code:
Thu Sep 13 10:20:10 PDT 2007
         total       used      free   shared   buffers    cached
Mem:  12302400    1816972  10485428        0    237344    887920
-/+ buffers/cache: 691708  11610692
Swap: 1769464           0   1769464
do you run a program that needs a lot of memory ( for example open a 1 GB archive in midnight commander (mc) ...)

run
Code:
top
on a separate console and sort processes by memory usage (M - key) ... work on 1 and see what happens at top-s console ...
 
  


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 > Enterprise Linux Forums > Linux - Enterprise

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