A few things, mostly technical notes...

Thursday, February 24, 2005

How RAM is used in Linux



Stumbled upon a very good post here, which explains why "top" or similar utils always show all your RAM being used.

mine:> free -m
total used free shared buffers cached
Mem: 91 84 7 20 21 15
-/+ buffers/cache: 47 44
Swap: 513 58 455

The -/+ buffers/cache line shows how much memory is being used and is free.
91 Meg is the RAM available after being reserved plus occupied by Kernel (which
cannot be swapped out) .

You're good if you are not swapping much. I've ~ 58 Megs of swap being used, well, it is normal with hardly 90 some Megs of RAM.

Quote from sapphirecat's original thread: " The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn't used. Keeping the cache means that if something needs the same data again, there's a good chance it will still be in the cache in memory. Fetching the information from there is around 1,000 times quicker than getting it from the hard disk. If it's not found in the cache, the hard disk needs to be read anyway, but in that case nothing has been lost in time. "

No comments:

Followers


Creative Commons License
This work is licensed under a Creative Commons License.