📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Interactive latency spikes and workload stalls occur while swap I/O dominates Ubuntu 22.04 system resources.

Environment & Reproduction

Ubuntu 22.04 with memory-hungry applications; reproduce using constrained RAM and concurrent service bursts.

Root Cause Analysis

Working set exceeds physical memory, forcing frequent page reclaim and swap churn that starves CPU for useful work.

Quick Triage

Run free -h, vmstat 1, and top/htop to confirm high si/so rates and identify top memory consumers.

Step-by-Step Diagnosis

Correlate memory pressure with dmesg OOM hints, inspect cgroup limits, and check swappiness and zswap settings.

Illustrative mockup for ubuntu-22-04-lts — swap_thrashing_problem
High swap activity and slow response on Ubuntu 22.04 — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Reduce memory footprint, tune vm.swappiness, add RAM or swap as appropriate, and restart offending processes in a controlled sequence.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for ubuntu-22-04-lts — swap_thrashing_solution
Tuned swappiness and recovered performance on Ubuntu 22.04 — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Enable zram for burst absorption, enforce cgroup memory limits, or rebalance services across additional Ubuntu nodes.

Verification & Acceptance Criteria

Swap-in/out rates drop, response times recover, and no OOM kills occur during expected peak load.

Rollback Plan

Revert sysctl changes and service limits from backups if tuning causes instability or throughput regression.

Prevention & Hardening

Capacity-plan memory with headroom, monitor PSI metrics, and alert early on sustained reclaim pressure.

Related Ubuntu 22.04 topics include OOM killer events, JVM heap oversizing, and container memory limit misconfiguration.

Related tutorial: View the step-by-step tutorial for Ubuntu 22.04 LTS.

View all Ubuntu 22.04 LTS tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

man vmstat, kernel memory management docs, Ubuntu performance tuning guides, and cgroup v2 references.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.