Skip to content

Fix memory growth issue in the Processes detail view - #4

Merged
Danil-Didkovskiy merged 3 commits into
mainfrom
fix-memory-leak
Jun 18, 2026
Merged

Fix memory growth issue in the Processes detail view#4
Danil-Didkovskiy merged 3 commits into
mainfrom
fix-memory-leak

Conversation

@Danil-Didkovskiy

@Danil-Didkovskiy Danil-Didkovskiy commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Previously, every opened process detail CPU/Memory history graph kept collecting history in the background. Opening many process detail pages could make the renderer use more and more memory over time. Now, MoStats keeps only a limited set of recently viewed process graphs alive. Recent graphs still feel responsive when revisited, but older unused graph history is automatically cleaned up.

Also, it adds video to README.md.

@Danil-Didkovskiy Danil-Didkovskiy self-assigned this Jun 18, 2026
Copilot AI review requested due to automatic review settings June 18, 2026 18:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses renderer memory growth in the Processes detail view by bounding how many per-process detail histories are retained in memory, evicting inactive histories over time, while keeping recent histories responsive when revisited. It also updates the README to include a demo video link.

Changes:

  • Add a bounded “recently viewed” cache for process detail histories (count limit + inactivity TTL) and prune associated side caches (access timestamps, sampled revisions, frozen buffers).
  • Adjust detail history sampling to avoid resampling the same snapshot revision per key and to buffer ticks only for the actively inspected detail while frozen.
  • Add a demo video link to README.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/renderer/components/processes/use-process-histories.ts Implements bounded retention + pruning policy for process detail history trails and related caches to prevent unbounded memory growth.
src/renderer/components/processes/process-explorer-view.tsx Passes the active detail key into the history hook so it can manage recency/retention correctly.
README.md Adds a video link demonstrating the app.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Danil-Didkovskiy
Danil-Didkovskiy merged commit b988147 into main Jun 18, 2026
3 checks passed
@Danil-Didkovskiy
Danil-Didkovskiy deleted the fix-memory-leak branch June 18, 2026 19:59
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.

3 participants