A server becomes unresponsive for minutes at a time and then recovers; `vmstat` during the event shows high `si`/`so`.
IntermediateTroubleshootingProcesses, memory and OOM
Answer
Likely causes → Heavy swapping (thrashing): the working set exceeds RAM and the kernel spends its time moving pages.
Diagnose →
vmstat 1
sar -W 1 5 # pswpin/s pswpout/s
for f in /proc/[0-9]*/status; do awk '/^Name|^VmSwap/{printf "%s ", $2} END{print ""}' $f; done | sort -k2 -n | tail
cat /proc/pressure/memory
Fix → Find the process pushing memory, reduce its footprint or limit it with MemoryHigh=. Add RAM if the workload legitimately needs it.
Prevent → Use systemd-oomd or earlyoom to kill runaway processes before the host thrashes.
More on Processes, memory and OOM
A Java service disappears without an error in its own log. `dmesg` shows `Out of memory: Killed process 4121 (java) total-vm:... anon-rss:...`.BeginnerA service gets killed with `Memory cgroup out of memory: Killed process ...` but the host has 20 GB free.Intermediate`ps` shows dozens of processes in state `Z` with `<defunct>`.BeginnerZombie count keeps climbing into the thousands and new processes fail with `fork: Resource temporarily unavailable`.AdvancedAn app crashes under load with `java.io.IOException: Too many open files` (or `EMFILE`).BeginnerYou raised `nofile` in `/etc/security/limits.conf` to 65536, but the service still shows `Max open files 1024`.Intermediate