Skip to content

Reduce desktop memory usage #417

Open

Description

@linroid

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.

Activity

  1. changed the title [-]Reduce desktop memory usage to ~100 MB at idle[/-] [+]Reduce desktop memory usage[/+] on Oct 7, 2026
  2. self-assigned this
    on Oct 8, 2026
  3. added
    enhancement
    on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions