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 |
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 |
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 |
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. |
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 |
Any Ideas?
|
Code:
Thu Sep 13 10:10:10 PDT 2007 cached= 4866208 for more Code:
cat /proc/meminfo |
Code:
Thu Sep 13 10:20:10 PDT 2007 run Code:
top |
All times are GMT -5. The time now is 04:28 AM. |