3

I've seen sysadmins playing with /proc/sys/vm/drop_caches (echo 3 into this file from a cron) in order to free caches. Is there a real interrest in doing this? Aren't the clean caches reclaimed when needed?

Thanks.

francois
  • 51
  • 3

1 Answers1

2

In normal operation it's not necessary. The normal reason for doing it is to be able to test the performance of some program when it is running with a cold cache.

TomH
  • 1,290
  • 7
  • 10
  • 3
    To add, having the caches freed periodically can actually *hurt* system performance, since often-used files will have to be read from disk again and again. Essentially, free memory is wasted memory (if the caching is implemented correctly). – user1686 Feb 21 '12 at 15:42