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

memory leaks #1

Closed
brainpicture opened this issue Jun 29, 2010 · 3 comments
Closed

memory leaks #1

brainpicture opened this issue Jun 29, 2010 · 3 comments

Comments

@brainpicture
Copy link

Try to create and delete parser obj, and memory will leak

@astro
Copy link
Collaborator

astro commented Jun 29, 2010

I can reproduce your problem but am not sure what to do. The culprit seems to be node invoking the v8 GC only after 2s of idle time. With manual usage of "node-gc" the script runs in constant space:

var sys = require('sys');
var expat = require('./build/default/expat');
var gc = require('gc');
var GC = new gc.GC();

function foo() {
    var p = new expat.Parser();
    setTimeout(foo, 1);
    sys.puts(sys.inspect(GC, true, 10));
    GC.collect();
}

foo();

I could also need help running node with valgrind. :-)

@brainpicture
Copy link
Author

Аfter some code refactor parser started deleting. my fault, Thanks for your advice

@astro
Copy link
Collaborator

astro commented Jul 4, 2010

Please test commit b362d93. I replaced expat's memory alloc functions and pass the size deltas to v8. This way, the GC gets invoked more often because it sees demand. I didn't observe performance regressions.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants