Force Memory to FREE on Linux Systems

free up ram memory


These days I faced with excessive loading of memory on a Linux system. Fortunately there are some tips to free up RAM memory and see how much memory is available in real time! It is like you run garbage collector for memory on Linux!


How to free up ram memory on Linux (from terminal)

There are two ways to free up ram memory on Linux (booth from terminal) but personally i prefer the second one!


Open terminal and type:  /proc/meminfo

It will return something like this:

 ~ $cat /proc/meminfo 
    MemFree:        340996 kB

Where 340996 kB is how much RAM memory is free currently.


Open terminal and type: free -m

This will return more extensive statistics with RAM Memory and look like this:

                 total       used       free     shared    buffers     cached
    Mem:          1024        691        332          0         86        288
    -/+ buffers/cache:        316        708
    Swap:         2047         68       1979

When an application need more memory than is free the Linux Kernel will release memory from buffers + cached and will allocate to application if need.

So in the above example total available memory which can be allocated to an application is:
free + buffers + cached => 332 + 86 + 288 = 706 MB

I will explain you what mean all:

total : is total RAM memory installed on computer;
used : is currently used RAM memory on the computer (with buffers and cached memory)
shared : memory that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies. (read more on Wikipedia)
buffers : is something that has yet to be “written” to disk;
cached : is something that has been “read” from the disk and stored for later use;


You can easily use free  and the results will be in bits;

free -m = display memory information in MB
free -k = display memory information in KB
free -g = display memory information in GB

I think this is clear now why I’ve used free -m


You know now how to get free memory on Linux (run garbage collector) and how to read how much memory is free on computer!


One Comment on "Force Memory to FREE on Linux Systems"

  1. diego says:

    the title is completely wrong!!! how can you be so silly?

    “how to free memory” is different from “how to get free memory”

Got something to say? Go for it!