

Glances and nmon – htop and top Alternatives.atop – For Linux server performance analysis.htop – interactive process viewer and manager.In addition to the free command, you can also use the following commands to check your Linux system’s memory usage: Measure Linux web server memory usage correctly.
Linux see free memory how to#
How to diagnose OOM errors on Linux systems (guest post by blog sponsor Datadog).What is iowait and how does it affect Linux performance?.Linux Performance: Almost Always Add Swap.Linux Performance: Why You Should Almost Always Add Swap Space.Linux server needs a RAM upgrade? Check with top, free, vmstat and sar.I’ve written some other articles on this topic that you may find helpful:

Each admin will have to answer those questions and others, case by case, or hire an expert to do so.ĭon’t be caught looking at “free” memory on your Linux system and jumping to conclusions because you should also consider available memory, buffers/caches and other factors as outlined. These are the questions that resulted in the current state of those above servers. When analyzing these systems, a sysadmin may ask a few pertinent questions: Is swapping slowing the performance of Server A? Or, is it opportunistic swapping? Should we downgrade memory on server B? Or, is traffic/workload growth expected soon? Should Server A be upgraded with more memory? Or, during peak hours/swap, does “load average” stay well below 12.00? Can Server B be configured to use more buffers and cache? Would such a change improve performance (is it worth changing)? 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). 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.
