[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How to reduce cached memory?



On Sat, 2009-02-07 at 11:00 +0100, Joshua C. wrote:
> 2009/2/7 Adrian Joian <adrian joian fedoraproject ro>:
> Than you everyone for the replies. Swapping do occurs (although
> rarely) but this is not my concern. What I don't like is the fact,
> that the kernel fills the memory with "what he thinks I would use/like
> or have already used". I didn't know it will use the cached memory in
> case it's needed.
> 
> But then is the question: When swapping occurs where have the other
> 2,6 gb ram gone? I don't believe I've opened so many apps that can
> consume so much memory.

The kernel is moderately aggressive about using swap, using it before
it's strictly required by swapping out pages that haven't been used for
a while to keep a certain amount of 'free' memory available.

You can tune this behaviour by stuffing a higher or lower numeric value
into /proc/sys/vm/swapiness -- 0 uses swap as little as possible, 100
frees as much RAM as possible, and the default is 60.

-Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]