[CentOS] Flush memory on a server?
Gordon Messmer
gordon.messmer at gmail.com
Sat Sep 9 21:05:27 UTC 2017
On 09/09/2017 04:43 AM, Nicolas Kovacs wrote:
> I read up a bit on RAM consumption, and now I wonder if flushing the
> memory cache regularly is a good idea.
Typically, no. Whatever pages of memory the system has swapped out are
pages that the kernel's counters indicate are less often used than the
pages that are in RAM.
The presence of pages in swap isn't necessarily bad. If, on the other
hand, you were seeing pages actively swapped in and out of swap, that
might indicate that the system needs more RAM than it has.
You can tune how conservative the system is about swapping memory in
exchange for file cache by setting the "vm.swappiness" system parameter.
More information about the CentOS
mailing list