πŸ“– ~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

System runs without swap, causing early OOM kills under memory pressure.

Environment & Reproduction

Common after moving swap file or editing fstab on Ubuntu 22.04 LTS.

Root Cause Analysis

Swap entry path, UUID, permissions, or fstab syntax is invalid at boot.

Quick Triage

Confirm swap file exists and has mode 600 before enabling.

Step-by-Step Diagnosis

Inspect systemd swap unit and boot logs for activation errors.

Illustrative mockup for ubuntu-22-04-lts β€” swap-off-problem
swapon –show returns empty β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Recreate and initialize swap file, then persist it in /etc/fstab.

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-off-fix
Swap file active after fstab correction β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Use a dedicated swap partition if swap file performance is insufficient for workload.

Verification & Acceptance Criteria

swapon –show displays active swap after reboot and memory pressure tests stabilize.

Rollback Plan

Remove new swap entry and restore previous fstab if boot warnings increase.

Prevention & Hardening

Track swap configuration in versioned infrastructure scripts and monitor OOM events.

Often coincides with high memory consumption by Java, browser, or container workloads.

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

See Ubuntu swap file guidance and man swapon, man mkswap.

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.