On a system with huge memory available: 12TB of RAM

echo 3 > /proc/sys/vm/drop_caches 

takes like half an hour to complete.

Does anyone know a faster alternative to drop_caches? I'm using RHEL 6.5 on this server. Do you know if more recent RHEL (like 6.6+ or 7+) improves drop_caches speed ?

  • 4
    Why are you running this command? X-Y Problem? Can you give some context? – ewwhite Oct 14 '16 at 11:48
  • 2
    I'm running this command to empty my cache in order to test the performance of my system and I don't want to use pre-cached data but want to read it again. – Fabien Oct 14 '16 at 13:46

If you need to reset the system after a test run, why not quick reboot using kexec-reboot?

This would probably reboot the server in 45-60 seconds, and is a much cleaner approach to what you're doing.

Also see: Is it possible to reboot a Linux OS without rebooting the hardware?


The faster alternative is to remove ram.

The only thing I could think of dropping caches is for test purposes. Or what is your use case? Remember, this doesn't drop the cache completely. As soon as the command has been executed it starts over again to use caching.


  • Exactly, that's for test purposes. Our faster alternative was to reboot this server... – Fabien Oct 14 '16 at 8:37
  • Do you want to do this once in a while (after eg running a test suite) or permanently? – HeinzPeter Oct 14 '16 at 9:50
  • We run multiple tests during one week (each run lasts approximately 12 hours) and we need to empty cache after each run. – Fabien Oct 14 '16 at 11:14
  • What do you mean by permanently ? – Fabien Oct 14 '16 at 11:14
  • You could run the command every few seconds in a loop - that's what I meant with permanently. – HeinzPeter Oct 14 '16 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.