Link to home
Start Free TrialLog in
Avatar of amandowara
amandowaraFlag for India

asked on

Clearing Memory cache in Linux

Hello,

In order to make the Kernel drop the pagecaches, we use the following commands:
 
# sync
# echo 1 > /proc/sys/vm/drop_caches
 
We want to know if it is safe to do this in Production servers at regular intervals and if not, what is the other method to clear the unwanted Memory caches?
 
Some of the forums which I went through says, that it shouldn't really matter whether we drop caches or not, the kernel should take care of this when the server need more memory. Like throw away some of it's file-cache to make room for your programs. BUT it doesn't seems to be happening all the time. In some servers when we aren't dropping the caches using the above command, we did faced performance issue. After we drop the cache, we did see an improvement in the server performance. Can you please explain us, why the System kernel couldn't do its own Memory management and why does it need a human intervention to clear its unwanted pagecaches ?
 
Our server are built with RHEL 5.2 32/64 bit
 

 
Thanks
Ashok
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial