Skip to content

fix: cleanup after a map has been removed#574

Closed
dopenguin wants to merge 0 commit intonextfrom
vue3/fix-memory-leak
Closed

fix: cleanup after a map has been removed#574
dopenguin wants to merge 0 commit intonextfrom
vue3/fix-memory-leak

Conversation

@dopenguin
Copy link
Copy Markdown
Member

Summary

Some parts were not properly being cleaned up leading to an explosion in RAM usage after multiple additions and removals of an additional map in snowbox. This, too, would be the case for any SPA that rerenders POLAR.

Instructions for local reproduction and review

npm run snowbox here and on next. Check the Snapshot size difference after multiple additions and removals. It should be fairly less now.
Note that there is still some overhead of about 100kb - 200kb per instance. I was not able to remove that and it may be an issue with vue directly.

@dopenguin dopenguin added this to the POLAR@3 milestone Mar 3, 2026
@dopenguin dopenguin self-assigned this Mar 3, 2026
@dopenguin dopenguin added the bug Something isn't working label Mar 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

PR Preview Action v1.8.0

QR code for preview link

🚀 View preview at
https://Dataport.github.io/polar/pr-preview/pr-574/

Built to branch gh-pages at 2026-03-17 16:14 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@dopenguin dopenguin force-pushed the vue3/fix-memory-leak branch 5 times, most recently from 7c96842 to 2e8a936 Compare March 12, 2026 11:36
@dopenguin dopenguin force-pushed the vue3/fix-memory-leak branch from 2e8a936 to 133c2d5 Compare March 17, 2026 16:12
Copy link
Copy Markdown
Member

@warm-coolguy warm-coolguy left a comment

Choose a reason for hiding this comment

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

🏓 @dopenguin

Compared next to vue3/fix-memory-leak on Windows, Chrome. Ran npm run dev with both branches.

Testing sequence:

  1. Load snowbox, wait a little, take snapshot
  2. Add 20 clients, remove all clients
  3. Take snapshot
  4. GOTO 2

Repeated testing resulted in an additional 5MB snapshot size per loop. Growth behaviour was identical between branches. Didn't review the code since changes seem to be ineffective.

@dopenguin dopenguin closed this Mar 30, 2026
@dopenguin dopenguin force-pushed the vue3/fix-memory-leak branch from 133c2d5 to 52b4515 Compare March 30, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants