-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Memory leak in node:vm
#23913
Labels
Comments
Can confirm this leaks memory. It seems to be caused by something in our implementation of |
Smaller reproduction: import vm from "node:vm";
const script = new vm.Script("returnValue = 2+2");
for (let i = 0; i < 1000; i++) {
script.runInNewContext({}, { timeout: 10000 });
} I think the leak is coming from the fact that we bootstrap and load all modules again, vs just creating a new global object. |
littledivy
added a commit
to littledivy/deno
that referenced
this issue
May 24, 2024
We create a context in the snapshot for the VM module to reuse. This patch fixes an oversight in the node:vm rewrite which created a new context every time which led to high memory usage. Fixes denoland#23913
nathanwhit
pushed a commit
that referenced
this issue
Jun 13, 2024
zebreus
pushed a commit
to zebreus/deno
that referenced
this issue
Jul 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using this package, deno causes a memory leak where node does not
sindresorhus/get-urls#89 (comment)
deno 1.43.5 (release, x86_64-unknown-linux-gnu)
v8 12.4.254.13
typescript 5.4.5
The text was updated successfully, but these errors were encountered: