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 )


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






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



sysctl -w vm.drop_caches=3



Prashant Deshpande




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.