Skip to content

Instantly share code, notes, and snippets.

@PlushZ
PlushZ / notes.md
Last active June 17, 2025 16:29
Use ZRAM to prevent OOM kills

ZRAM to prevent OOM kills

When training ML models, you can observe that Linux out-of-memory (OOM) killer terminates the process in the middle of training, even on high-RAM machines (e.g., 64 GiB RAM). This can be caused by the system running out of RAM.

To solve this, consider enabling ZRAM, a Linux kernel feature that provides compressed swap space in RAM, giving fast, efficient memory overflow handling without relying on slow disk-based swap.

Usage

Install ZRAM tools