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

perf(loader): manually deregister listeners setup by loader to prevent memory leaks #167 #168

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

TillaTheHun0
Copy link
Member

Closes #167

There is an open issue in emscripten that it causes memory leaks on WASM that is loaded multiple times. This is due to event listeners that are created that reference the 16MB memory allocation set up for the WASM, and are never deregistered. Because the listeners are never deregistered, the 16MB can never be garbage collected, which will eventually cause node to run out of memory.

This PR adds a utility to the loader that tracks listeners created as part of the WASM, and deregisters them once the invocation is complete.

@TillaTheHun0 TillaTheHun0 merged commit 9b2201c into main Nov 16, 2023
3 checks passed
@TillaTheHun0 TillaTheHun0 deleted the tillathehun0/ao-loader-memory-leak-167 branch November 16, 2023 17:19
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.

Memory Leak in the CU
1 participant