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

vm memory leaks #2140

Closed
juggle73 opened this issue Jul 9, 2015 · 1 comment
Closed

vm memory leaks #2140

juggle73 opened this issue Jul 9, 2015 · 1 comment
Labels
v8 engine Issues and PRs related to the V8 dependency. vm Issues and PRs related to the vm subsystem.

Comments

@juggle73
Copy link

juggle73 commented Jul 9, 2015

Hi.

Next code give me memory leaks.

var vm = require("vm");
var result;
var pool = {test:42};

setInterval(function () {
    context = vm.createContext(pool);
    result = vm.runInContext("test=56;", pool);
    console.log(pool);
    console.log(parseInt(process.memoryUsage().heapTotal / 1024 / 1024));
}, 2);

Does anybody have idea how to resolve this problem?
Thanks.

@bnoordhuis
Copy link
Member

You posted a related question on v8-users, didn't you? https://groups.google.com/forum/#!topic/v8-users/vnZdcFxFcMY

FWIW, your example works for me. If you run it with --max_old_space_size=24, heap size flattens out at 17 MB and RSS is stable.

I'll close the issue because I don't see a bug but let me know if you have evidence to the contrary.

By the way, your example has a minor bug. This line:

result = vm.runInContext("test=56;", pool);

Should read:

result = vm.runInContext("test=56;", context);

@brendanashworth brendanashworth added v8 engine Issues and PRs related to the V8 dependency. vm Issues and PRs related to the vm subsystem. labels Jul 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants