You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arch Linux / AUR builds OOM on 16 GB systems during release linking (candle/wgpu + LTO) #1196
When building lightcraft on Arch Linux via the AUR package (lightcraft-0.6.0-1) or when building release binaries from source on machines with 16 GB RAM and high CPU thread counts (e.g. 16–20 threads), the build consistently fails due to Out-Of-Memory kills (systemd-oomd / kernel OOM-killer) during the final linking step.
During cargo build --release, Cargo builds both lightcraft and lightcraft-cli concurrently. Because the workspace includes heavy dependencies (candle-core, wgpu, egui, liblightcraft_web.so), linking both binaries simultaneously requires substantial memory.
In the AUR package, the build environment also specifies:
The combination of DEBUG=2 (generating massive DWARF symbols) and CODEGEN_UNITS=1 + LTO=thin causes rustc's codegen unit (lto cgu.0.rcgu.) to consume over 6–7 GB RSS per process. When both binaries link in parallel on a high-thread system, peak memory usage exceeds 10 GB RSS and 9 GB swap, triggering systemd-oomd and terminating the terminal session:
kernel: lto cgu.0.rcgu.: page allocation failure: order:0, mode:0xc0de0
systemd-oomd[1029]: Marked ... for killing due to memory used (16.4 GB) / total (16.4 GB) and swap used (14.8 GB) / total (16.4 GB) being more than 90.00%
systemd[1289]: app-ghostty-...scope: systemd-oomd killed 84 process(es) in this unit.
systemd[1289]: app-ghostty-...scope: Failed with result 'oom-kill'.
Resolution
The build succeeds reliably on 16 GB systems by:
Limiting concurrent cargo jobs (e.g. CARGO_BUILD_JOBS=1 or 2) so both large binaries aren't linked simultaneously.
Avoiding DEBUG=2 and CODEGEN_UNITS=1 with LTO on memory-constrained systems.
Opening this issue to:
Document this behavior for users and downstream packagers building from source on machines with <= 16 GB RAM.
Note for Arch Linux / AUR maintainers (such as Caleb Maclennan) to relax CARGO_PROFILE_RELEASE_DEBUG and CODEGEN_UNITS=1 or serialize binary linking in the PKGBUILD.
Activity
LR-BUILD: document command-local low-memory release overrides (storyt…
aiongg commentedon Oct 21, 2026
Documented in v0.8.0: README → low-memory release builds; the PKGBUILD change is for the AUR package.
Merge pull request storytold#1196 from emmertex/fix/modern-ui-review