Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚑 Fix severe memory leak (high memory consumption) #858

Merged
merged 2 commits into from
Jun 3, 2022

Conversation

jinh0
Copy link
Collaborator

@jinh0 jinh0 commented May 31, 2022

What is fixed

Fixes #767 .

Dereferences SVG object when NeonCore.edit() is called.

In my personal usage, what used to take up to 16 GB of RAM on my computer now takes up only 300 MB of RAM.

Memory usage in Neon should now be consistent (except due to the storing of strings in undo/redo stacks).

Tested on

Google Chrome, Safari, and Microsoft Edge.

EDIT: Works on Firefox as well.

What still needs to be done

Storing of strings must be fixed in the future.

The MEI string and SVG object of neonCache should be accessed through a memory-safe function.

jinh0 added 2 commits May 31, 2022 15:22
Regarding the change of variable name from `mei` to `svg`: all other functions and classes refer to SingleView's `mei` as `svg`, and the type itself of the variable is `SVGSVGElement`. There is only one <svg> element that matters, so there is no vagueness in its name.
@jinh0 jinh0 requested a review from yinanazhou May 31, 2022 19:29
@jinh0 jinh0 changed the title ⚡️ Fix severe memory leak (high memory consumption) 🚑 Fix severe memory leak (high memory consumption) May 31, 2022
@jinh0 jinh0 mentioned this pull request Jun 2, 2022
@yinanazhou yinanazhou merged commit ec6767f into develop Jun 3, 2022
@jinh0 jinh0 deleted the memory-fix branch June 3, 2022 15:36
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