Skip to content

Memory hog: Update checks never release memory to the system - #2438

Open
lewisgoddard wants to merge 1 commit into
mainfrom
fix/lewisgoddard/memory-use
Open

Memory hog: Update checks never release memory to the system#2438
lewisgoddard wants to merge 1 commit into
mainfrom
fix/lewisgoddard/memory-use

Conversation

@lewisgoddard

@lewisgoddard lewisgoddard commented Jul 27, 2026

Copy link
Copy Markdown
Member
  • Add concurrency guard to flatpak FileMonitor events, coalesce the monitor events into a single refresh once activity settles.
  • Guard trigger_update_check so refreshes cannot stack.
  • malloc_trim() after each update check to hand the free'd memory back to the OS.

Free's ~500MiB outside of update checks.

…ates

Each change to a flatpak installation fires many FileMonitor events, and
every event queued a full reload of both AppStream pools. With no debounce
and no re-entrancy guard, routine flatpak activity stacked reloads whose
large transient allocations ratcheted RSS to a multi-hundred-MB high-water
that glibc never returned, so an idle --silent daemon sat near a gigabyte.

Coalesce the monitor events into a single refresh once activity settles,
guard trigger_update_check so refreshes cannot stack, and malloc_trim()
after each update check to hand the freed transients back to the OS.
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.

1 participant