How to Check RAM Usage in Ubuntu Linux

The Memory Bottleneck

Unlike hard drive space, which stores files permanently, Random Access Memory (RAM) is the temporary workspace your Ubuntu Linux server uses to actively run programs. If your server is hosting a busy MySQL database and a heavy Apache web server simultaneously, those applications will rapidly consume the available RAM. If the physical RAM completely fills up, the server will begin using a “swap” file on the much slower hard drive, causing the entire system to grind to a halt. To prevent catastrophic slowdowns, you must constantly monitor how much memory your server is actively using.

Using the free Command

The Linux free command instantly audits the system’s memory chips and outputs the current utilization statistics.

  1. Open your Terminal application (Ctrl + Alt + T) or log into your server via SSH.
  2. To view the current memory usage, type the following command exactly:
    free -m
  3. Press Enter.

Understanding the Output

The -m flag is critical. If you just type free, Linux outputs the memory in raw kilobytes, which is difficult to read. The -m flag converts the output into Megabytes (MB). The terminal will display two main rows: “Mem:” and “Swap:”. Look at the “Mem:” row. The “total” column shows the physical RAM installed in the machine, the “used” column shows exactly how much memory is actively being consumed by applications, and the “available” column shows the true amount of free memory remaining before the server begins to struggle.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.