Skip to content

feat(trayapp): trim the heap after the popup is hidden#424

Merged
kdroidFilter merged 1 commit into
masterfrom
feat/gc-on-popup-hide
Jul 18, 2026
Merged

feat(trayapp): trim the heap after the popup is hidden#424
kdroidFilter merged 1 commit into
masterfrom
feat/gc-on-popup-hide

Conversation

@kdroidFilter

Copy link
Copy Markdown
Collaborator

Summary

  • The TrayApp popup keeps its composition alive while hidden (state survives hide/show), so garbage from the visible session lingers for as long as the app idles in the tray — exactly the footprint users check in the task manager.
  • Trigger a GC ~1.5 s after the exit animation completes, in both implementations (standalone panel on Windows/macOS, window on Linux).
  • No visible jank: nothing is on screen when the collection runs, it executes off the UI thread, and reshowing the popup restarts the visibility effect which cancels the pending delay — rapid toggles never GC.
  • Audio-safe with native playback backends (e.g. composemediaplayer/rodio): their pipelines run on non-JVM threads, which JVM safepoints do not pause.

Test plan

  • macOS: open popup, close it — memory drops ~2 s later, no visual glitch
  • Rapid open/close toggles do not trigger repeated collections
  • Linux window impl: same behavior on hide

The popup keeps its composition alive while hidden so state survives
hide/show — garbage from the visible session otherwise lingers for as long
as the app idles in the tray, which is exactly the footprint users check in
the task manager. Trigger a collection ~1.5s after the exit animation ends:
no UI is on screen so the pause is invisible, reshowing cancels the pending
delay (free debounce), and the call runs off the UI thread.
@kdroidFilter
kdroidFilter merged commit 5638dc5 into master Jul 18, 2026
4 checks passed
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