Skip to content

Reduce memory usage in launcher and notification image handling - #17

Merged
ry2x merged 3 commits into
mainfrom
enchance/ram-usage-reduce
Sep 3, 2026
Merged

ry2x merged 3 commits into
mainfrom
enchance/ram-usage-reduce

Conversation

@ry2x

@ry2x ry2x commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Lazily initialize the application catalog and load launcher content only when opened.
  • Extract notification image lifecycle management into a dedicated resource store.
  • Add thumbnail generation with bounded workers, caching, cancellation, and cache pruning.
  • Add a memory scenario for retained notification images after hiding the panel.

Copilot AI lite review requested due to automatic review settings September 3, 2026 12:36
@ry2x
ry2x merged commit fc369c6 into main Sep 3, 2026
1 check passed
@ry2x
ry2x deleted the enchance/ram-usage-reduce branch September 3, 2026 12:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Notification image loading can fail silently when thumbnail subscription throws, leaving pictures blank without falling back to the original URI.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR targets lower steady-state and startup memory usage by deferring app-launcher initialization until first open, and by centralizing notification image lifecycle management with thumbnail generation, caching, cancellation, and cache pruning.

Changes:

  • Lazily initialize the application catalog and only compute launcher results after launcher content is first shown.
  • Move notification image binding/release logic into a dedicated NotificationImageResources store and introduce thumbnail generation with bounded workers and cache pruning.
  • Extend memory-scenario tooling with a new notification hide/retain scenario.
File summaries
File Description
src/widget/common/NotificationCard.tsx Switches notification image binding to the new NotificationImageResources and uses thumbnail mode for large images.
src/widget/app-launcher/index.tsx Defers mounting launcher content until first open and triggers state content loading on visibility.
src/widget/app-launcher/AppLauncherContent.tsx Extracts launcher UI/content into a lazily mounted component and exposes focus/reset via a handle.
src/stores/notification/notificationThumbnail.ts Adds thumbnail job queue with bounded workers, subscriber fanout, and cache pruning.
src/stores/notification/notificationImage.ts Introduces centralized notification image resource management with map/unmap-based loading/release and optional thumbnail subscription.
src/stores/application/applicationCatalog.ts Makes app catalog/history initialization lazy to reduce baseline memory usage.
src/stores/application/appLauncher.ts Adds contentLoaded gating to avoid loading/searching applications before launcher is opened.
debug/run-memory-scenarios.sh Adds a new memory scenario for hiding the panel with retained notification images.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +128 to +130
} catch (error) {
console.error(error);
}
Comment on lines +35 to +39
const info = file.query_info(
'standard::size,time::modified,time::modified-usec',
Gio.FileQueryInfoFlags.NONE,
null
);
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.

2 participants