Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The disk cache takes too much memory in my OpenVZ VPS. How can I disable or limit disk cache memory usage globally?

I am using CentOS 6.4.

share|improve this question
Why would you want to limit the disk cache in use? What is your use case? – Chris Down Apr 23 '13 at 8:45
up vote 3 down vote accepted

If you want to decrease the likelihood of VFS caching, increase the VFS cache pressure by tuning the value of /proc/sys/vm/vfs_cache_pressure (the default is 100). This will aggressively reclaim dentries and inodes from memory. 1000 might be a good starting point. On my system a setting of 1000 reduces slab by around 75% or so.

Note that this is probably not what you want to do, however. There are very few use cases that you want to reduce filesystem cache memory usage -- it is freed for use by programs as soon as they need it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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