Monthly Archives: September 2013

HOW to clean unused memory … Ubuntu

Since yesterday when we tried to stop glassfish service on server it is getting hanged in between and we need to kill and after killing the java process if we check free-m command we didn’t seen full memory free approx. 2 GB was used by some of applications and we are not able to find which applications are those so I have studied a bit and using below command we can see the list of applications along with its memory usage.

 

ps -e -o pid,vsz,comm= | sort -n -k 2

 

which has given below output and then I could identified that one service Whoopsie and rsyslogd were utilizing approx. 1 GB of RAM and after searching on internet come to know that whoopsie is error reporting service to Ubuntu ( which uploads errors to https://daisy.ubuntu.com )

Reference

http://askubuntu.com/questions/135540/what-is-the-whoopsie-process-and-how-can-i-remove-it

So I had stopped that service. Using ” service whoopsie stop” command

The second top memory using application was rsyslogd which is again a open source application which is installed in our template so I had stopped service for it too,

 

After this execute below command to see the cached / unused memory status

 

watch -n 1 cat /proc/meminfo

 

Then executed below command to release unused memory from OS

sysctl -w vm.drop_caches=3

 

the above command cleans deentres , Inodes and dirty page cache from meory

 

BEFORE

 

AFTER

 

This is allow glassfish to use the more memory if required and I feel will resolve stopping issue of glassfish service also.

So scheduled cron job to free unused memory after specific interval as below and resolved issue J

 

Sync

sysctl -w vm.drop_caches=3

 

Thanks

Prashant Deshpande

 

 

Advertisements

Leave a comment

Filed under Uncategorized