free -h. Read the available column: it is the kernel’s estimate of how much RAM new programs can use without swapping. buff/cache is disk cache that Linux frees when programs need it, so low free is normal. To see which processes use the most RAM, run ps -eo pid,user,rss,%mem,comm --sort=-rss | head.
Before you start
- Connect with SSH. The commands here don’t need
sudo. freereads/proc/meminfo, so it shows what the operating system sees. On a VPS that is the RAM in your plan, minus a little the kernel reserves.
How to check memory usage with free
-h prints human-readable units. Use -m for mebibytes or -g for gibibytes.
What the free columns mean
A server with little free memory and a large buff/cache is healthy. Linux uses spare RAM as cache and gives it back when a program needs it. You only have a memory problem when available is low.
How to watch memory over time
vmstat, watch si and so (memory swapped in and out per second). Values above 0 on every line mean the server is short of RAM and using swap, which is much slower than memory.
How to find which process uses the most memory
RSS (resident set size) is the physical RAM a process uses, in KiB. Several processes of the same program (PHP-FPM workers, Apache) share some memory, so adding their RSS values overstates the total.
For an interactive view, open htop and press M to sort by memory. See monitor resources with htop.
To see memory per service rather than per process:
Memory: line shows what the whole service (all its processes) uses. Replace mariadb with your service name.
How to check swap usage
How to tell if the server ran out of memory
When RAM and swap are both exhausted, the kernel’s out-of-memory (OOM) killer ends a process. Check the kernel log:Out of memory: Killed process 2038 (mariadbd) names the victim. Fixes are in fix out of memory killed processes.
What to do if memory is low
1
Find the biggest user
Run the
ps command above or htop, sorted by memory.2
Restart or tune it
A leak often clears after
sudo systemctl restart name. For databases, PHP-FPM and Java game servers, lower their memory settings (buffer pool, pm.max_children, -Xmx).3
Cap it
Stop one program taking all the RAM with a
MemoryMax= limit. See limit CPU and memory for a process.4
Add swap or RAM
Add a swap file as a safety net, or move to a plan with more memory.
Frequently asked questions
Why is my free memory so low when nothing is running?
Linux fills spare RAM with file cache. Check available, not free. If available is high, you have plenty of memory.What is the difference between free and available memory?
free is RAM holding nothing at all. available adds the cache and other memory the kernel can reclaim, so it shows the real room for new programs.Why does my VPS show slightly less RAM than my plan?
The kernel reserves some memory for itself at boot, sototal is a little lower than the installed RAM. That is normal on every Linux server.
How do I see memory usage in MB?
Runfree -m. For gigabytes use free -g (rounded down) or free -h.
Related guides
VPS and dedicated server guides
Every server guide in one place.
Fix out of memory errors
When the OOM killer strikes.
Add swap space
Create a swap file safely.
Monitor resources with htop
Live view of every process.
Limit CPU and memory
systemd MemoryMax and CPUQuota.
VPS Panel resource graphs
Memory use over time.
Checked against the free(1), ps(1) and vmstat(8) manuals and the Linux kernel /proc/sys/vm documentation on 4 November 2026; commands tested on Ubuntu 24.04 LTS. Commands can differ on other distributions or releases.
Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026