0

Possible Duplicate:
Linux high memory usage (top total mismatch)
High Memory Usage on Linux Server

CentOS 5.7 dedicated server. No memory intensive processes running. 12GB RAM installed.

Mem:  12462256k total, 12425344k used,    36912k free,   395528k buffers
Swap:  1999864k total,      344k used,  1999520k free, 10795472k cached

I contacted our server provider and they said:

The cached content is about 10 GB and this is information that is often accessed by the system, this way the server is able to faster access it when the information is needed. This information can always be freed and memory to be allocated for other needs.

Does that make sense?

I checked another server with only 4GB of RAM. It's also "doing nothing" but sure enough has 99% of RAM marked as "used". But in that case very little of it is marked as "cached".

Mem:   3969436k total,  3945568k used,    23868k free,   352740k buffers
Swap:  2097144k total,  1206984k used,   890160k free,    53232k cached

Can anyone make sense of this?

3 Answers3

0

Server is dedicated to running what? Albeit weird indeed, I have seen this behaviour in virtualbox vm server. Still, I think the answer of the serve provider is adequate. They seem to be using the available ram as a fast storage location. There must be an application (or a system driver) that chews your RAM.

"Top" is a bit hard to navigate into. Try "htop" where you can check out things more easily. There is colour coding on the RAM usage meter, so you can check out if user or system is using up this RAM.

nass
  • 598
0

You're thinking, "I'd like to have more RAM free so I can use it later". But you don't need to have RAM free now to use it later. In fact, it's easier to use it later if it's in use now -- you don't have to do anything at all to use it later. So your question is basically "Why are things so good? Shouldn't they be worse?"

Free RAM is a pure cost. If you leave 1GB free for 10 minutes, you've forever lost the chance to use that memory for that time. You can't use an extra 1GB later. So modern operating systems only leave RAM free if they have no other choice, as it's just wasted. Only about 32MB is needed, and that's for cases where RAM is needed in contexts in which it's not possible to directly transition from one use to another (for example, during a disk interrupt).

-1

Sure, Linux uses all RAM: both for applications and for file system cache. You may better check it with "cat /proc/meminfo". Have a look at "Cached" and "Buffers" lines

eppesuig
  • 313
  • 1
  • 11