release used memory

Mulyadi Santosa mulyadi.santosa at gmail.com
Fri Mar 11 20:26:24 EST 2011


Hi :)

On Sat, Mar 12, 2011 at 00:54, Andreas Leppert <wudmx at web.de> wrote:
> In the following, I'm refering to that two lines of top which look something
> like that:
>
> Mem:   8185716k total,  5603224k used,  2582492k free,     9104k buffers
> Swap:  8388604k total,        0k used,  8388604k free,  5374400k cached
>
> While the bzip program runs, it uses memory and thus, the value before "free"
> in the Mem: line is getting smaller. As you can see above, there is also some
> "cached stuff" (5374400k). What is meant by this value? Someone explained me
> that it has to do something with filesystem buffers which were read or
> written. Could you elaborate on this?

You probably need to read my articles (written by Mulyadi Santosa) in
these below URLs :)

http://fullcirclemagazine.org/issue-39/
http://www.linux.com/learn/tutorials/42048-uncover-the-meaning-of-tops-statistics


>Instead,
> nothing happens and kswapd is activated. What's the sense of keeping some
> filesystem buffers when they are not used anymore?

As the end user, you probably know your own usage pattern (i.e "i
won't read that file anymore"), but the kernel doesn't know that. So
the best it can do is keep them on RAM as long as it can. But to make
it somewhat more efficient (not hanging there for eternity), there's
page swapping algorithm ran that swap them out from RAM using certain
aging or replacement algorithm.

What you saw was probably they were not "old" enough to be swapped
out...thus they stayed.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list