Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ocnc
Copy link

@ocnc ocnc commented Dec 31, 2025

Note

Addresses memory leaks in snap execution lifecycle.

  • In IframeExecutionService.terminateJob, cast to HTMLIFrameElement, navigate to about:blank, then remove the iframe to ensure the prior document unloads (notably for Firefox)
  • In BaseSnapExecutor.onTerminate, remove unhandledrejection and error listeners if registered and clear handler refs to enable garbage collection

Written by Cursor Bugbot for commit 4e1b218. This will update automatically on new commits. Configure here.

This fix should address:

MetaMask/metamask-extension#38847
MetaMask/metamask-extension#34428
MetaMask/metamask-extension#35567

My profiler showed a firefox extension (Metamask) hogging > 10GB of RAM, and the digging lead to finding event listeners aren't cleaned up on termination

@ocnc ocnc requested a review from a team as a code owner December 31, 2025 21:18
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.

1 participant