Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
When a Linux desktop workstation freezes completely—unresponsive mouse cursor, frozen clock, dead keyboard shortcuts, and no SSH response—it is easy to blame the GPU driver, the Wayland compositor, or a kernel panic. However, many multi-hour desktop lockups on modern Linux distributions are actually executable page-cache thrashing livelocks caused by full zram swap and an unconfigured swap OOM policy.
This post walks through a real-world post-mortem on an Aurora (Universal Blue / Fedora Kinoite 44) workstation running KDE Plasma Wayland, showing how to diagnose system freezes using journalctl and sysstat (sar), identify the root causes (kde-baloo and systemd-oomd configuration gaps), and permanently fix the issue.
1. Symptoms of the Freezes¶
The workstation hardware and software environment:
OS: Aurora (Fedora Kinoite 44 Atomic Desktop, KDE Plasma 6 on Wayland)
Hardware: 62 GiB physical RAM, 8 GiB
zram0compressed in-RAM swap, NVIDIA RTX 3070 GPU
Over two consecutive days, the system experienced two severe freezes:
Freeze #1 (Self-Recovered After >1 Hour): Triggered immediately after pressing
Alt+F3(the KWin window operations menu shortcut) inside a Chromium-based browser. The entire GUI locked up for over an hour before spontaneously recovering on its own.Freeze #2 (Hard Reboot After ~2.5 Hours): Occurred the following afternoon during normal desktop usage. The system remained completely unresponsive for roughly 2.5 hours until forced off via the hardware power button.
2. Diagnosing System Freezes with journalctl and sar¶
When investigating a freeze after a reboot, two tools provide complementary visibility:
journalctl: Captures kernel and userspace daemon warnings leading up to and recovering from the freeze.sysstat(sar): Records periodic system activity counters (/var/log/sa/sa<DD>) for memory, swap, and paging every 10 minutes.
Step 1: Locate the Previous Boot in journalctl¶
List recorded boots to find the boot index of the frozen session (-1 is the immediately preceding boot):
journalctl --list-boots
journalctl -b -1First, check kernel logs for hardware faults, GPU hangs (NVRM / Xid), kernel panics, or kernel OOM killer invocations:
journalctl -b -1 -kSurprisingly, none occurred—there were no kernel panics, no NVIDIA GPU hangs, and not a single kernel or systemd-oomd OOM kill during either freeze.
Step 2: Recognize Userspace Thrashing Signatures in journalctl¶
Inspecting the full system journal around the freeze window revealed classic symptoms of severe memory thrashing and CPU/IO scheduling starvation:
rtkit-daemon[...]: The canary thread is apparently starving. Taking action.
rtkit-daemon[...]: Demoting known real-time threads.
kwin_wayland[...]: The main thread was hanging temporarily!
chronyd[...]: Forward time jump detected!
systemd-udevd[...]: ... Worker [...] processing SEQNUM=... is taking a long time
systemd-udevd[...]: ... Worker [...] processing SEQNUM=... killed
at-spi2-registryd[...]: Disabling unresponsive app with pid ...Key observations from the journal timeline:
Complete Logging Gap: For the duration of the freeze (over 1 hour in Freeze #1 and 2.5 hours in Freeze #2), not a single log line was written to disk—even
sysstat’s background timer could not get scheduled.How Freeze #1 Recovered: At the exact moment Freeze #1 ended, a Flatpak Chrome instance logged:
GPU process exited unexpectedly: exit_code=512When that single browser process finally crashed, it released enough anonymous memory to break the paging livelock, allowing
kwin_wayland,chronyd(which noticed a massive forward wall-clock jump), and user input to resume immediately.
Step 3: Reconstruct Memory, Swap, and Paging Activity with sar¶
Use sar against the daily sysstat data file (/var/log/sa/sa<DD>, where <DD> is the two-digit day of the month) to inspect memory (-r), swap (-S), and paging (-B) metrics:
# Memory utilization (-r), swap utilization (-S), and paging statistics (-B)
sar -f /var/log/sa/sa14 -r
sar -f /var/log/sa/sa14 -S
sar -f /var/log/sa/sa14 -BThe sar output exposed the exact mechanism of the freeze:
RAM and ZRAM Swap Saturation (
sar -randsar -S):Physical memory (
%memused) climbed above 96%.The 8 GiB
zram0swap device was 100.0% full (kbswpfree = 0) for hours leading up to the freeze.
Catastrophic Page-Cache Thrashing (
sar -B): Right as the freeze began (and upon recovery whensadccould finally flush its sample), paging counters spiked to extreme levels:pgpgin/s: ~596,850 KB/spgscank/s: ~1,655,982 pages/s (kswapd scanning over 1.65 million pages per second!)majflt/s: ~424 major page faults/s
Why Does Full Swap Cause a Complete Livelock Without Triggering OOM?¶
When anonymous memory (heap/stack allocations) fills almost all 62 GiB of RAM and 100% of the 8 GiB zram swap:
The kernel can no longer swap out anonymous pages because
kbswpfree = 0.To satisfy any memory allocation or page fault (such as pressing
Alt+F3in KWin to render a popup menu), the kernel’s only remaining reclaimable memory is file-backed page cache—including the executable code pages (mmap-ed binaries and shared libraries likelibc.so,libQt6*.so,kwin_wayland, and Chrome).The kernel evicts executable code pages that are actively in use. Less than a millisecond later, the CPU tries to execute the next instruction in that process, triggering a major page fault (
majflt/s) to read the binary page back from the NVMe SSD (pgpgin/s), which immediately evicts another process’s active code page.Because file-backed pages are technically still being reclaimed, the kernel’s in-kernel OOM killer believes memory reclaim is “making progress” and never fires, leaving the machine in a multi-hour livelock.
3. Root Causes Identified¶
Culprit #1: KDE Baloo File Indexer (baloo_file / baloo_file_extractor)¶
Inspecting cgroup memory and swap usage on a fresh boot revealed an unexpected memory hog: kde-baloo.service (KDE’s file and content indexing daemon).
The workstation’s
$HOMEdirectory contained ~600,000 files, including source code repositories, compiled HTML documentation builds, Jupyter notebooks, and data archives.Because Baloo indexes both filenames and full file contents by default, its LMDB database at
~/.local/share/baloo/indexhad ballooned to 26.75 GiB.Within just 1 hour 40 minutes of a fresh boot,
kde-baloo.servicehad consumed:15.6 GiB of physical RAM (throttled right against its systemd cgroup
MemoryHighlimit), plus6.1 GiB of the 8 GiB
zramswap (with a peak swap consumption of 7.9 GiB!).
In short, baloo_file single-handedly consumed nearly 100% of the system’s zram swap and a quarter of physical RAM while constantly thrashing against its MemoryHigh boundary.
Culprit #2: Multiple Flatpak Chrome / Chromium Instances¶
Alongside Baloo, multiple long-running Flatpak Chrome and Chromium browser instances accumulated 8–35 GiB of RSS across dozens of tabs, renderer processes, and GPU buffers. Combined with Baloo’s 22+ GiB footprint, total memory demand exceeded physical RAM + swap.
Culprit #3: Why systemd-oomd Never Intervened¶
Modern Fedora distributions ship systemd-oomd to prevent userspace thrashing before a kernel livelock occurs. Running oomctl revealed why systemd-oomd stood by idly:
oomctlDry Run: no
Swap Used Limit: 90.00%
Default Memory Pressure Limit: 60.00%
Default Memory Pressure Duration: 20s
System Context:
Memory: Used: ...
Swap: Used: 6.1G Total: 8.0G
Swap Monitored CGroups:
Memory Pressure Monitored CGroups:
Path: /user.slice/user-1000.slice/user@1000.service
Memory Pressure Limit: 80.00%
Path: /system.slice
Memory Pressure Limit: 80.00%Notice the critical gap: Swap Monitored CGroups: was completely empty!
Even though Swap Used Limit: 90.00% was configured globally in oomd.conf, no slice had ManagedOOMSwap=kill enabled. Only ManagedOOMMemoryPressure=kill (at an 80% PSI threshold over 20s) was active on user and system slices. When zram hit 100%, systemd-oomd was not monitoring swap exhaustion on any cgroup.
4. Solutions and Mitigations¶
Fixing the workstation permanently requires three layers of defense:
Eliminate the runaway memory/swap consumer (
kde-baloo).Enable proactive swap-based OOM killing in
systemd-oomd(ManagedOOMSwap=kill).Enable Magic SysRq keys (
kernel.sysrq = 244) as a manual hardware-level escape hatch.
Solution 1: Disable and Purge the KDE Baloo File Indexer¶
What Does Baloo Do (and What Happens When You Disable It)?¶
Baloo (baloo_file and baloo_file_extractor) maintains an inverted index of filenames and file contents so that Dolphin and KRunner can perform instant full-text searches inside documents.
Disabling Baloo does NOT break:
Launching applications in KDE Application Launcher or KRunner (
Alt+Space)KRunner plugins (calculator, window switching, system settings, unit conversion, recent documents)
Basic filename search in Dolphin (Dolphin automatically falls back to standard directory traversal when Baloo is disabled, or you can use fast CLI tools like
fdandrg)
For developer workstations with hundreds of thousands of source, build, and virtual-environment files in $HOME, Baloo’s content indexer is notorious for runaway LMDB growth and swap exhaustion.
Commands to Disable and Purge Baloo¶
# 1. Disable Baloo in KDE configuration
balooctl6 disable
# 2. Stop the systemd user service directly
# (Required if baloo_file is stuck thrashing and 'balooctl6 purge' hangs or times out)
systemctl --user stop kde-baloo.service
# 3. Purge the multi-gigabyte index database (~/.local/share/baloo/index)
balooctl6 purge
# 4. Verify Baloo is disabled and stopped
balooctl6 statusOn our workstation, stopping kde-baloo.service and purging the index immediately freed 26.75 GiB of disk space, reclaimed 15.6 GiB of RAM, and dropped system swap usage from 6.1 GiB down to 0 B.
(Tip: If you ever want filename-only indexing without content indexing, you can configure System Settings → Search → File Search, uncheck Also index file content, and add heavy developer directories like ~/archives, ~/.cache, and .venv to the exclusion list.)
Solution 2: Enable Swap-Based OOM Killing in systemd-oomd¶
To ensure systemd-oomd kills the largest swap consumer whenever total swap usage exceeds 90%—before the kernel runs out of swap and livelocks on executable pages—enable ManagedOOMSwap=kill on the root cgroup slice (-.slice).
Why Is the Root Slice Named -.slice?¶
In systemd unit naming conventions, filesystem paths are converted into unit names by replacing / with -. Therefore, the root cgroup path / corresponds to the unit name -.slice, and its drop-in configuration directory is /etc/systemd/system/-.slice.d/.
CLI Tip: Because
-.slicestarts with a hyphen (-), standard CLI tools interpret it as a command-line flag unless you pass--(end of options) first:systemctl status -- -.slice ls -la -- /etc/systemd/system/-.slice.d
Configure ManagedOOMSwap=kill on -.slice¶
Create the drop-in file /etc/systemd/system/-.slice.d/10-oomd-root-slice-defaults.conf:
sudo mkdir -p -- /etc/systemd/system/-.slice.d
sudo tee /etc/systemd/system/-.slice.d/10-oomd-root-slice-defaults.conf > /dev/null <<'EOF'
[Slice]
ManagedOOMSwap=kill
EOFReload systemd and restart systemd-oomd:
sudo systemctl daemon-reload
sudo systemctl restart systemd-oomdVerify with oomctl that the root cgroup / is now actively monitored under Swap Monitored CGroups::
oomctlDry Run: no
Swap Used Limit: 90.00%
Default Memory Pressure Limit: 60.00%
Default Memory Pressure Duration: 20s
System Context:
Memory: Used: 14.2G Total: 62.5G
Swap: Used: 0B Total: 8.0G
Swap Monitored CGroups:
Path: /
Swap Usage: (see System Context)
Memory Pressure Monitored CGroups:
Path: /user.slice/user-1000.slice/user@1000.service
Memory Pressure Limit: 80.00%
Path: /system.slice
Memory Pressure Limit: 80.00%With this configuration in place, if swap ever reaches 90% (7.2 GiB of 8 GiB), systemd-oomd will automatically terminate the offending cgroup (such as a runaway browser tab or background indexer) instead of allowing the entire desktop to freeze.
Solution 3: Enable Magic SysRq Keys (kernel.sysrq = 244) as a Manual Last Resort¶
During Freeze #2, pressing Alt+SysRq combinations failed to work, and the kernel journal logged:
kernel: sysrq: This sysrq operation is disabled.By default, Fedora sets kernel.sysrq = 16, which only allows the S (Emergency Sync) command and disables both manual OOM invocation (F) and safe rebooting.
Understanding the kernel.sysrq = 244 Bitmask¶
Setting kernel.sysrq = 244 (4 + 16 + 32 + 64 + 128) enables all recovery, signaling, and filesystem-safety keys while keeping potentially sensitive kernel memory/register dumps disabled:
Magic SysRq Bitmask Breakdown for 244
Bit Value | Capability Enabled | SysRq Keys Unlocked |
|---|---|---|
| Control of keyboard / console logging |
|
| Sync mounted filesystems |
|
| Remount filesystems read-only |
|
| Process signaling (term, kill, oom-kill) |
|
| Reboot / poweroff |
|
Persist kernel.sysrq = 244 Across Reboots¶
Create /etc/sysctl.d/90-sysrq.conf and apply it immediately:
echo "kernel.sysrq = 244" | sudo tee /etc/sysctl.d/90-sysrq.conf
sudo sysctl -p /etc/sysctl.d/90-sysrq.confHow to Use Magic SysRq During a Freeze¶
Because the Magic SysRq handler executes directly inside the Linux kernel interrupt context, it works even when Wayland, kwin_wayland, and userspace daemons are completely frozen:
First Choice — Trigger a Manual OOM Kill (
Alt + SysRq + F): HoldAlt + SysRq(often labeledPrintScreen/PrtSc) and pressF. The kernel immediately invokes the in-kernel OOM killer to terminate the single largest memory-consuming process, freeing gigabytes of RAM and unfreezing your desktop within seconds without losing your session.Last Resort — Safe Reboot (
R -> E -> I -> S -> U -> B): If the system still does not recover, holdAlt + SysRqand slowly pressR,E,I,S,U,B(pausing ~1–2 seconds between keys) to cleanly terminate processes, flush caches, remount disks read-only, and reboot without risking filesystem corruption.
5. Summary Checklist¶
If your Fedora / Universal Blue KDE Plasma workstation suffers from inexplicable freezes:
Check previous boot logs with
journalctl -b -1and paging stats withsar -f /var/log/sa/sa<DD> -r -S -B.Check whether
kde-baloo.servicehas bloated~/.local/share/baloo/indexand exhaustedzramswap; disable and purge it withbalooctl6 disable && systemctl --user stop kde-baloo.service && balooctl6 purge.Verify
oomctlshows/underSwap Monitored CGroups:by settingManagedOOMSwap=killin/etc/systemd/system/-.slice.d/10-oomd-root-slice-defaults.conf.Set
kernel.sysrq = 244in/etc/sysctl.d/90-sysrq.confsoAlt+SysRq+Fis always available to slay a runaway memory hog on demand.