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

ESM Modules implementations leak memory #9959

Open
SimenB opened this issue May 3, 2020 · 4 comments
Open

ESM Modules implementations leak memory #9959

SimenB opened this issue May 3, 2020 · 4 comments

Comments

@SimenB
Copy link
Member

SimenB commented May 3, 2020

🐛 Bug Report

The new experimental implementation leaks memory.

To Reproduce

Steps to reproduce the behavior:

Using node 13 or 14 (for unflagged ESM)

$ git clone git@github.com:facebook/jest.git
$ cd jest
$ yarn
$ cd e2e/native-esm
$ node --experimental-vm-modules ../../packages/jest/bin/jest.js --detect-leaks

Expected behavior

It should not leak

Link to repl or repo (highly encouraged)

This repo

@grosto
Copy link
Contributor

grosto commented May 16, 2020

I had a look and it seems that the issue is with Node. The references to SourceTextModule are not cleaned up properly. I will look into it more, but 90% that's it. I will open an issue in Node if it's true and will mention this issue.

@grosto
Copy link
Contributor

grosto commented May 17, 2020

SourceTextModule never get collected by GC and thus everything they hold reference too.
Here is the issue: nodejs/node#33439

@SimenB
Copy link
Member Author

SimenB commented May 17, 2020

Thanks @grosto!

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants