Skip to content

System hang on OOM due to missing swap configuration in Ubuntu Asahi (M-series Mac) #179

@toshithh

Description

@toshithh

Hi team,

I've encountered a serious stability issue on Ubuntu Asahi running on an Apple Silicon M2 Mac. When system memory is fully used, the machine becomes completely unresponsive — including the power button — and must be hard-rebooted.

After investigation, I found that no swap is configured by default, which likely causes the kernel to deadlock under memory pressure.


Steps to Reproduce:

  • Boot into Ubuntu Asahi on an M2 Mac (mine has 8GB).
  • Run memory-intensive applications or simulate high memory usage (stress, browsers, etc.).
  • Once RAM is fully consumed, page faults increase rapidly.
  • The system freezes entirely — no response to keyboard, mouse, or power button. Only a forced shutdown works.

Diagnosis:

  • free -h
    confirms that no swap is configured.
  • Without swap or zram, the kernel has no fallback when memory is exhausted.
  • The OOM killer appears unable to recover, resulting in a full system hang.

Suggested Fixes:

  • Enable a default swapfile during installation (e.g., 2–4 GB minimum).
  • Or, configure zram (via zram-tools) to provide compressed in-RAM swap, which avoids SSD wear.
  • Provide a setup option or install-time prompt for swap configuration.

System Info:

  • Model: MacBook Air M2
  • RAM: 8GB
  • Kernel: 6.14.0-1001-asahi-arm
  • Ubuntu Version: Ubuntu 24.04.2 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions