How to Check Available Memory Using the free Command in Linux

When a massive database compilation or a Java application begins to violently consume system resources on a Linux server, the system can enter a state of catastrophic memory starvation. To force the Linux kernel to mathematically probe the physical RAM architecture and dump a real-time matrix of total, consumed, and available memory, you must deploy the free command.

Executing the Memory Diagnostic

The free command is a highly optimized extraction engine. It bypasses user-space abstractions, queries the absolute /proc/meminfo kernel file, and outputs a strict table detailing both physical RAM and virtual Swap space.

Executing a Basic RAM Probe

To execute the diagnostic extraction, open your terminal and type:

free

The exact millisecond you press Enter, the free engine rips the data from the kernel and outputs a raw integer matrix. However, by default, the engine outputs the payload in absolute kilobytes (e.g., 16324824), which is mathematically difficult for a human to parse rapidly.

Targeting Human-Readable Geometry

To force the engine to algorithmically convert the raw kilobyte integers into highly readable Megabytes (MB) or Gigabytes (GB), you must inject the -h (human-readable) flag.

free -h

The engine recalculates the payload and outputs a pristine matrix. The most critical columns for immediate diagnostic analysis are:

  • total: The absolute physical maximum RAM installed in the server architecture.
  • used: The exact mathematical amount of RAM currently consumed by active processes.
  • available: The true, absolute amount of RAM available for starting new applications (without forcing the kernel to brutally utilize slow disk-based Swap space). This is the only integer that matters when diagnosing an impending memory crash.

Get the best tech tips delivered straight to your inbox.

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