Back to lessons

Linux Survival Basics

Check Memory Pressure Quickly

A VPS feels slow, and people often restart daemons before checking whether memory pressure is the cause.

Command

free -h

What changed

Nothing changes. free prints total, used, free, shared, buff/cache, and available memory.

Danger

safe

When to use it

Use during slowdowns, deploy validation, memory alerts, or before resizing a VPS.

When not to use it

Do not use it to identify which process is responsible; follow up with ps, top, or systemd-cgtop.

Undo or recovery

No undo needed because the command is read-only.

Expected output

A memory table with total, used, free, buff/cache, and available columns.

demo script

Disposable terminal steps

  1. free -h
  2. uptime

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ free -h
               total        used        free      shared  buff/cache   available
Mem:           1.9Gi       1.3Gi       120Mi        12Mi       420Mi       390Mi
Swap:          2.0Gi       128Mi       1.9Gi
::exit-code::0
$ uptime
 14:34:10 up 2 days,  4:18,  1 user,  load average: 0.32, 0.58, 0.71
::exit-code::0

YouTube Short

Is your VPS out of memory?

Before restarting services or resizing the server, check memory pressure. On Linux, focus on available memory.

LinkedIn hook

See whether memory is actually tight before restarting services.

Question: Which memory column do you trust first on Linux: free, used, or available?

experiments

A/B tests to run

Metric: rewatch_rate

A: Explain why low free memory can be normal.

B: Show only the available-memory rule of thumb.