Checking the Kernel Ring Buffer for the Eviction Event
out_of_memory(). It calculates a badness score for running processes—heavily weighting the proportion of physical RAM consumed—and abruptly terminates the highest-scoring candidate to keep the operating system functional.
You can verify this immediately using dmesg or journalctl to search for kernel messages associated with the invocation:
BASH
dmesg -T | grep -E -i 'oom[-_]killer|killed process'Reading Pressure Stall Information
free or used counters in free -m are misleading because Linux deliberately uses spare memory for file system caching (page cache) and reclaims it dynamically when applications request more space.
To see whether the system is struggling to satisfy memory requests, modern Linux kernels (version 4.20 and newer, with CONFIG_PSI=y enabled) provide Pressure Stall Information (PSI). PSI measures the real execution time lost because tasks are waiting for memory-related work, such as paging in code or waiting for direct page reclaim.
You can inspect memory pressure directly from the /proc filesystem:
BASH
cat /proc/pressure/memorysome and full. Both display rolling stall percentages over ten seconds, sixty seconds, and three hundred seconds (five minutes), alongside an absolute counter in microseconds showing the total cumulative stall time.
The some metric shows the percentage of time during which at least one active task on the system was blocked waiting for memory. This commonly happens during normal background writeback or routine page reclaim when web workers handle traffic. A small non-zero value on some during traffic peaks is normal for a small VPS.
The full metric represents complete stall time: the percentage of time during which all runnable tasks on the system were stalled waiting for memory simultaneously. In this state, no productive CPU work occurs because every active thread is waiting for the kernel to scavenge or swap pages. If the sixty-second or three-hundred-second average on the full line climbs above zero, your VPS is suffering severe memory thrashing. The OOM killer typically arrives shortly after full pressure stays sustained, because allocation requests begin to time out or queue up faster than the kernel can free physical pages.
Assessing True Headroom and Reclaim Health
/proc/meminfo and focus on MemAvailable.
MemAvailable is the kernel's estimate of how much RAM can be allocated to a new or expanding process without forcing the system into swap or direct reclaim. It takes into account non-reclaimable slab caches and the minimum watermark thresholds that the kernel reserves for its own core allocations. When MemAvailable drops below five to ten percent of total physical RAM, any sudden concurrency spike—such as multiple PHP-FPM workers spawning simultaneously—will drive allocation latency sharply upward.
At the same time, check whether your VPS has swap space configured and active. A small VPS without swap gives the kernel zero flexibility when anonymous memory (process heap and stack) expands. Without swap, the kernel can only free memory by dropping clean file-backed page caches. Once the page cache is depleted down to its essential binaries and libraries, the kernel has no further pages it can drop, leaving direct allocation failure as the only possible outcome.
Adding a modest swap file on NVMe or SSD storage does not degrade database performance under normal conditions; instead, it provides a buffer. It gives the kernel a place to push dormant background processes (such as logging daemons or idle SSH sessions), preserving unfragmented RAM for the primary web and database engines.
Establishing Headroom Before the Kernel Intervenes
/proc/pressure/memory or set up kernel threshold notifications via epoll rather than relying solely on total RAM utilization. Alerting on a sustained rise in the 60-second some pressure gives administrators minutes of warning to adjust pool sizes or investigate traffic anomalies before the system drops into full stalls.
For service stability, database buffer pools must be scaled to account for bursty neighbours on the same host, especially PHP processes. If an instance runs both a web server and MySQL, capping the database pool to leave ample room for peak web worker spikes prevents synchronous allocation stalls. By diagnosing pressure via PSI and maintaining a healthy MemAvailable reserve, you turn silent service drops into predictable, measurable capacity planning.