> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Determining a server's memory usage

> Discover how to check server memory usage with the free command in this concise guide featuring instructions and code snippets.

This article explains how to determine memory usage statistics on a server by using the **free** command.

## Using the free command

To determine memory usage statistics on a server, follow these steps:

1. Log in to the server [using SSH](/docs/using-ssh-secure-shell).

2. At the command prompt, type the following command:

   ```bash theme={null}
   free -m
   ```

   > 📘 Note
   >
   > For easier readability, use the **-m** option to display memory usage statistics in megabytes. To display statistics in bytes, run the **free** command without the **-m** option.

3. Interpret the **free** command output. For example, consider the following sample output from a server:

   ```
   root@example.com:~# free -m
                total      used      free    shared   buffers    cached
   Mem:          2003      1338       665         0       149      1015
   -/+ buffers/cache:       172      1830
   Swap:            0         0         0
   ```

You may be tempted to look at the **Mem** row, scan the **used** and **free** columns, and determine that the server is using 1338 MB of RAM, and the amount of free RAM is only 665 MB. However, this is incorrect. In fact, the server is only using 172 MB of RAM, and has 1830 MB of free RAM.

This is because Linux uses free memory for disk caching to improve performance. This memory, listed in the **buffers** and **cached** columns, is available immediately for any application that may need it. Although it is technically being "used" by Linux in the background, for all practical purposes this memory is free and available. So if you add the **free** memory (665 MB),**buffers** memory (149 MB), and **cached** memory (1015 MB) values, you obtain 1829 MB, which is the actual amount of memory available for applications. (The discrepancy between the 1829 MB that we calculated and the 1830 MB shown in the output is due to rounding because we used the **-m** option. If you run the **free** command without this option to obtain amounts in bytes, the numbers will add up exactly.)

<Tip>
  In newer versions of Linux, determining the amount of memory available for applications is significantly easier. This is because the output of the **free** command includes an **available** column. For example, consider the following sample output:

  ```
                total        used        free      shared  buff/cache   available
  Mem:           7882        2465        2278         666        3138        4458
  Swap:             0           0           0
  ```

  In this case, there is 4458 MB of memory available for applications.
</Tip>

## More information

For a humorous explanation of memory usage in Linux, please visit [http://www.linuxatemyram.com](http://www.linuxatemyram.com).

## Related articles

* [Monitoring resource usage](/docs/monitoring-resource-usage)

* [Managing the inode count](/docs/inode-count)
