
Please note that the Linux Kernel will move memory pages least frequently used into swap space even if there is available memory. Note, that both of these servers have 12 CPU cores and swap to RAID 10 NVMe storage – thanks to. When you compare both systems, even though the load averages are similar (processing the same workloads), it is evident that one server is making use of almost 100% of its memory ( Server A) while the other server is wasting more than 50% of its memory ( Server B).
LINUX SEE FREE MEMORY FREE
Server B: After 153 days of uptime, 30GB of memory is still wasted (free).Ībove lies the difference between free vs. Server A: Has less than 1% free (wasted memory), 13GB available memory. I also ran the uptime command to confirm that both systems have been online for some time. The result should look something like these two screenshots below. available memory in Linux, login to your server and enter the following command: free -h We are going to use the go-to command: free With this in mind, let’s look at two 60GB memory Linux servers. While available memory is used memory that includes but is not limited to caches and buffers, that can be freed without the performance penalty of using swap space. available memory in Linux is, that free memory is not in use and sits there doing nothing.

Available memory is then an estimation of how much memory is available for use without swapping. Once your applications/processes have launched and considerable uptime has passed, this number should almost always be small.Īvailable memory is the amount of memory that is available for allocation to new or existing processes.

For this reason, especially on servers, I like to consider free memory as wasted memory. What exactly is free memory and how is it different from available memory?įree memory is the amount of memory that is currently not used for anything. It reports lots of information about the installed RAM memory.Ok, let’s get right to it then. To find out hardware information about the installed RAM, use the demidecode command. Similar to the top command, the htop command also shows memory usage along with various other details. The buffer and cache information is present here too, like the free command. They indicate total, used and free amounts of the memory. Here is a sample outputĬheck the KiB Mem and KiB Swap lines on the header. The header on output has the required information. However it also reports total memory usage and can be used to monitor the total RAM usage. The top command is generally used to check memory and cpu usage per process. The vmstat command with the s option, lays out the memory usage statistics much like the proc command. They indicate same values of memory usage as the free command. They are rather virtual files that contain dynamic information about the kernel and the system.Ĭheck the values of MemTotal, MemFree, Buffers, Cached, SwapTotal, SwapFree. Know that the /proc file system does not contain real files.


The next way to check memory usage is to read the /proc/meminfo file. The free command is the most simple and easy to use command to check memory usage on linux. Just in case anyone found the title interesting enough: free -m
