The Resource Telemetry Vector
When an Ubuntu server running a heavy database (like MySQL) or a Java-based application suddenly crashes, the primary culprit is usually an Out of Memory (OOM) event. The Linux kernel, desperately trying to keep the operating system alive, will automatically assassinate the application consuming the most RAM. Before you blindly upgrade your server hardware, you must execute a command-line interrogation to analyze the exact mathematical distribution of the system’s Random Access Memory.
How to Check Memory Usage
Ubuntu provides a specialized, lightning-fast utility specifically engineered to parse the `/proc/meminfo` kernel file and output a highly readable telemetry grid regarding active RAM and Swap space allocation.
1. Open your terminal application or connect to the server via SSH.
2. The Primary Diagnostic Command (`free`):
* Typing the raw command `free` will output the data in bytes, which is mathematically unreadable for a human analyzing a 16GB server (e.g., `16384000`).
* You must append the -h (human-readable) or -m (megabytes) flag to force the tool to calculate the data into Gigabytes (G) or Megabytes (M).
* Type exactly:
free -h
* Press Enter.
3. Analyzing the Telemetry Grid:
* The terminal will output a small matrix with two primary rows: `Mem:` (Physical RAM) and `Swap:` (Hard drive space used as emergency overflow RAM).
* Focus exclusively on the `Mem:` row and these specific columns:
* total: The absolute maximum physical RAM installed on the server (e.g., `15Gi`).
* used: The exact amount of RAM actively locked by running applications (e.g., `8.2Gi`).
* free: The completely empty, untouched RAM (e.g., `1.1Gi`).
* buff/cache: (Crucial) The Linux kernel aggressively uses free RAM to cache hard drive data for faster access. This is good. The kernel will instantly dump this cache if an application actually needs the RAM. (e.g., `5.7Gi`).
* available: This is the most important number. This is the mathematical sum of `free` + `buff/cache`. This is the true amount of RAM available for new applications to use before the server crashes (e.g., `6.8Gi`). If the `available` column drops below 500Mi, your server is in critical danger of an OOM crash.