Search This Blog

Saturday, January 26, 2013

Freeing your RAM

Hi friends,
I was working on a server and suddenly the machine seemed to kind of slow. I guessed that my RAM was full and checked it. And as i suspected its free memory was less. I was shocked just by seeing the total used memory, it was way too high. I tried to trace down the processes but nothing seemed to consume so much.

   So i was assuming that one of the open source application which i was using had some memory leakage. So i wanted to make an investigation on that. All my attempts were failure. So from the experiment i understood the following about memory management in linux.

1. When ever some process is executed after usage it is cached to local storage
2. And this cached memory is not freed automatically.

So i found it, that was the culprit. This cached memory is the one that was occupying the RAM and RAM appeared to be full. So now i would be sharing you the command that would clear the cached memory in RAM and gives your system some space to breathe.

Here it is,

# sync; echo 3 > /proc/sys/vm/drop_caches

No comments:

Post a Comment