📖 ~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

Memory pressure leads to OOM kills because swap is missing or inactive.

Environment & Reproduction

Ubuntu 18.04 VMs where swapfile was removed, misconfigured, or not mounted after reboot.

Root Cause Analysis

Invalid /etc/fstab entry, incorrect swapfile permissions, or disabled swap policy.

Quick Triage

Use swapon –show, free -h, and grep swap /etc/fstab to verify active configuration.

Step-by-Step Diagnosis

Check swapfile existence, mode 600, and run sudo systemctl status proc-sys-fs-binfmt_misc.mount only if boot parsing errors appear.

Illustrative mockup for ubuntu-18-04-lts — ubuntu1804-swap-not-active-diagnose.webp
Checking swap devices, swappiness, and fstab entries — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Create swapfile with fallocate, chmod 600, mkswap, swapon, and persist 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-18-04-lts — ubuntu1804-swap-not-active-fix.webp
Creating and enabling swapfile on Ubuntu 18.04 — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Attach dedicated swap partition for predictable performance on high-memory-pressure workloads.

Verification & Acceptance Criteria

swapon –show lists active swap after reboot and OOM events decline.

Rollback Plan

Disable swap with swapoff and restore previous fstab if performance characteristics regress.

Prevention & Hardening

Set vm.swappiness appropriately and monitor memory plus swap usage trends.

Out of memory Kill process, swapoff failures, and fstab parse warnings.

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

View all Ubuntu 18.04 LTS tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

man swapon, man mkswap, and Ubuntu swapfile documentation.

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.