From everything I have read, RHEL will use all available/unused RAM for caching to increase performance.

However, this becomes an issue for me in a VMware environment. VMware (ESX4) looks for guest OS to let it (ESX) know when the guest is done using the memory so it will make it available it to another server.

So lets say I have a guest that has a dB, the dB runs an intensive job, it finishes and now its idle. But since it cached all the memory, VMware still thinks that the dB server needs it, so it doesnt release the RAM to be used by my webserver that needs the extra RAM. Sure I can live with as many guests as I have RAM, but that is a waste of a huge virtualization feature, since over all my CPU utilization is under 10% and my RAM utilization (as far as VMware knows) is 75%.

Any ideas?


One mechanism to reclaim memory from the DB server VM in your example would be the VMware Balloon driver (which is part of the VMware Tools):

This is VMware physical memory management driver which acts
like a "balloon" that can be inflated to reclaim physical pages
by reserving them in the guest and invalidating them in the
monitor, freeing up the underlying machine pages so they can
be allocated to other guests. The balloon can also be deflated
to allow the guest to use more physical memory.

See e.g. "3.3 Ballooning" in Understanding Memory Resource Management in VMware® ESX Server (pdf).

You could also run this little script

sync && echo 3 > /proc/sys/vm/drop_caches

in the DB server VM to explicitly free pagecache, dentries and inodes if you are sure you don't need the caches anymore.

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.