Skip to content

feat: OOM Killer Tuning script with CachyOS-inspired systemd-oomd config - #4

Draft
TuxLux40 wants to merge 1 commit into
mainfrom
claude/oomd-killer-tuning-script-w7xpvb
Draft

feat: OOM Killer Tuning script with CachyOS-inspired systemd-oomd config#4
TuxLux40 wants to merge 1 commit into
mainfrom
claude/oomd-killer-tuning-script-w7xpvb

Conversation

@TuxLux40

Copy link
Copy Markdown
Owner

Type of Change

  • New feature

Description

Adds core/tabs/system-setup/fixes/oomd-killer-tuning.sh — an interactive script that tunes the out-of-memory killer to prevent system freezes under memory pressure, mirroring the approach used by CachyOS.

What the script does

systemd-oomd tuning (primary path, requires systemd 247+, cgroup v2, PSI):

  • Writes /etc/systemd/oomd.conf.d/60-tuning.conf with CachyOS-inspired thresholds:
    • SwapUsedLimit=80% (upstream default: 90%)
    • DefaultMemoryPressureLimit=40% (upstream default: 60%)
    • DefaultMemoryPressureDurationSec=20s (upstream default: 30s)
  • All three values are user-configurable via interactive prompts; the CachyOS values are the defaults.
  • Enables ManagedOOMSwap=kill and ManagedOOMMemoryPressure=kill on user.slice and user@.service via drop-in configs so oomd actually monitors user sessions.
  • Enables and starts systemd-oomd.service.

earlyoom (optional supplement or standalone fallback):

  • If systemd-oomd prerequisites aren't met (older systemd, cgroup v1, no PSI), the script automatically offers earlyoom as the sole OOM killer.
  • When oomd is configured, earlyoom can still be installed as additional protection.
  • Supports pacman/AUR, apt, dnf, zypper, apk.
  • Writes /etc/default/earlyoom if the file exists (Debian/Ubuntu-style), with configurable free-memory and free-swap thresholds.

Prerequisite checks (informational, non-blocking):

  • cgroup v2 (/sys/fs/cgroup/cgroup.controllers)
  • PSI (/proc/pressure/memory)
  • systemd-oomd.service unit existence

Registered in System Setup → Fixes in tab_data.toml with task_list = "I SS PFM".

Issues / other PRs related

  • Resolves #

Generated by Claude Code

… config

Adds fixes/oomd-killer-tuning.sh which configures systemd-oomd with
more aggressive thresholds (SwapUsedLimit=80%, DefaultMemoryPressureLimit=40%,
DefaultMemoryPressureDurationSec=20s) to proactively kill memory-hungry
processes before the system becomes unresponsive — matching CachyOS tuning.

The script also enables ManagedOOM on user.slice / user@.service so oomd
actually monitors user sessions, and optionally installs earlyoom as a
supplemental or fallback OOM killer for systems without systemd-oomd.

Registers the entry under System Setup > Fixes in tab_data.toml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vEFroDTGqB5VMPHd4ZQhJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants