web analytics

How to Free Unused Memory in Ubuntu/Linux Mint

Ubuntu free up memory is demand of every person who is using Ubuntu/Linux, here in this article we will discuss methods to free up and release the unused or cached memory is easy, you can use any of these ways and can schedule it for your ease. Like Windows OS, easiest way is to restart machine, but when you have Ubuntu/Linux you don’t need to restart machine or even no need to install any third party softwares.

 

Check Memory Usage in Real-Time

You can check your current memory usage using this command:

watch -n 1 free -m

check in real-time your system memory usage:

watch -n 1 cat /proc/meminfo

Free Up Unused Memory

If you have cached or buffered Ram, You can use following tricks to clean your memory.

Trick #1:

You can free up unused memory under Ubuntu/Linux Mint using this command:

sudo sysctl -w vm.drop_caches=3

NOTE: this action won’t make your system faster nor it will affect its stability and performance, it will just clean up memory used by the Linux Kernel on caches.


Trick #2
Here is another command that can help you free up memory either used or cached (page cache, inodes, and dentries):

sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches


Trick #3

1. Freeing Up the Page Cache

echo 1 > /proc/sys/vm/drop_caches

2. Freeing Up the Dentries and Inodes

echo 2 > /proc/sys/vm/drop_caches

3. Freeing Up the Page Cache, Dentries and Inodes

echo 3 > /proc/sys/vm/drop_caches

4. Flushing the File System Buffers

sync

 

NOTE: You can use cron jobs to schedule the commands above to run at specific time intervals.

If you have more useful commands for releasing/flushing memory in Ubuntu/Linux Mint, use the comment form below.

Leave a Reply

%d bloggers like this: