LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Memory utilization - Centos 5.0 (https://www.linuxquestions.org/questions/linux-newbie-8/memory-utilization-centos-5-0-a-716429/)

Matosh 04-02-2009 04:19 PM

Memory utilization - Centos 5.0
 
Hi all,

I have problem with memory utilization, is much to high. Server has 2GB RAM but the usage is around above 90% all the time.
According to command:

[root@server /]# free
total used free shared buffers cached
Mem: 2056232 1986764 69468 0 26768 1541936
-/+ buffers/cache: 418060 1638172
Swap: 4192956 136 4192820
[root@server /]#


More clear:

Total: 2,056,232 -> 2GB
Used: 1,986,764 -> 1.9GB
Free: 69,468 -> 69MB

But using tool System->Administration->"System Monitor"->Resources
User memory is only 408MB of 2GB which is 20.3%

So I don't know why I do have such a different between command "free" and monitoring tool?

And then how can I display which process which use the most memory?

Thanks for your time.

lazlow 04-02-2009 04:54 PM

Ok, Linux handles memory differently than windows. Linux does its best to use all the resources it can all the time. So, when a program is not using ram, the system automatically reallocates that ram, usually to cache and buffers. Now when there is a program that needs more memory, linux again reallocates the ram to the program, usually from cach and buffers.

johnsfine 04-02-2009 05:31 PM

Quote:

Originally Posted by lazlow (Post 3496551)
Linux handles memory differently than windows.

Not a lot differently and not in any way that is relevant to this question so far.

If you want the relevant Windows/Linux difference here, it is in the tool for reporting memory usage rather than in the actual memory usage.

In Linux, free is giving useful information in a way that usually confuses beginners. Similar tools in Windows give less information and less useful information that is intended more to make the user comfortable than to inform.

Quote:

when a program is not using ram, the system automatically reallocates that ram, usually to cache and buffers. Now when there is a program that needs more memory, linux again reallocates the ram to the program, usually from cach and buffers.
Correct, so the idea that too much ram is being used, in this case, is just a misunderstanding of the information shown by free

Quote:

Originally Posted by Matosh (Post 3496523)
-/+ buffers/cache: 418060 1638172

If you want the beginner view of used/free memory, look at this line rather than the line above it. The first number is used memory and the second number is free memory.

Matosh 04-02-2009 07:33 PM

Quote:

Originally Posted by johnsfine (Post 3496575)
If you want the beginner view of used/free memory, look at this line rather than the line above it. The first number is used memory and the second number is free memory.

So, if my server has 2GB RAM and Used is 418MB and Free is 1.6GB, right?
is that a real and reliable data?

johnsfine 04-02-2009 09:31 PM

Quote:

Originally Posted by Matosh (Post 3496660)
So, if my server has 2GB RAM and Used is 418MB and Free is 1.6GB, right?
is that a real and reliable data?

Yes, that free output does show about 0.4GB "used" and about 1.6GB "free.

The beginner view of anything is subject to qualifications and assumptions that you can't reasonably explain to a beginner.

If you need a simple measure of used vs. free physical ram, that line of the output from free is the best simple measure. It is real and reliable data for what it measures.

In fact it measures the amount of "used" memory excluding buffers/caching and the amount of "free" memory including buffers/caching.


All times are GMT -5. The time now is 12:27 AM.