Repository navigation
Open
Labels
enhancementNew feature or request
Description
Goal
Reduce the Ketch desktop app's memory footprint to approximately 100 MB of total process memory at steady idle in a packaged release. Treat this as an optimization target, with active-workload peaks measured separately.
Context
The desktop launcher currently uses -Xms32m -Xmx512m. These settings only control the Java heap; native graphics allocations, thread stacks, class metadata, and compiled code also contribute to process memory. Establish a measured baseline before choosing changes; no current memory measurement is attached to this issue.
Existing measurement guidance: docs/development/testing.md#desktop-startup-memory.
Work
- Profile heap and native/process memory in packaged desktop releases; identify the largest contributors and retained allocations.
- Measure launch, steady idle with the main window open, background/tray launch, and idle after using and closing downloads and Discover views.
- Investigate unnecessary eager initialization, retained UI/resources, caches, buffers, and thread/client lifetimes. Tune JVM settings only after measuring their effect on performance and stability.
- Include configured Discover credentials and saved history, concurrent HTTP and torrent downloads, and repeated window hide/reopen cycles.
Acceptance criteria
- Record reproducible before/after measurements, including OS, architecture, release build, process-memory metric, window size, dataset, and fixed idle interval. Exclude Gradle/Kotlin daemons and do not force GC for ordinary idle measurements.
- Reach approximately 100 MB total process memory at steady idle, or document the measured gap, limiting factors, and concrete follow-up work if the target is not feasible with the current stack.
- Report active-workload peaks and post-workload idle memory separately; verify repeated use does not cause unbounded growth.
- Preserve startup responsiveness, download throughput, concurrent download stability, Discover behavior, saved history, and UI state across hide/reopen.
- Validate on supported desktop platforms and document platform-specific results.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
[-]Reduce desktop memory usage to ~100 MB at idle[/-][+]Reduce desktop memory usage[/+]