-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Memory leak when using asynch #501
Comments
Nothing there indicates a leak. On October 26, 2015 11:19:37 AM GMT+02:00, Ofer Herman notifications@github.com wrote:
|
It looks as if there is no reuse of resources it's strange that the RES memory reaches 150M for it, but it might be my misunderstanding of how node/V8 allocates memory. Changed the test to make 2 iterations of 2K calls each and the memory consumption goes higher between each iteration.
This is the output after the first iteration:
And this is the output after the 2nd one:
|
You have not mentioned which version of Node this is, but I'll assume it's 4. Does not really matter, though, since I would not expect RSS to decrease here. nodejs/node#2631 (comment)
You can also run node with --trace-gc to see when garbage collection happens. For reference, last time we had an actual leak, the system ran out of memory in 15 to 30 minutes. |
Tried the same loop as in nodejs/node#2631 and it crashes after ~15 sec Using node version 0.12.7 |
Looks like it's a nodejs issue not NAN http://stackoverflow.com/questions/33346385/how-can-i-use-uv-queue-work-multiple-times |
I've created a minimal asynchronous addon based on async_pi_estimate and ran it in a loop. It appears that there is a memory leak when using it because the code itself doesn't allocate dynamic memory but after running 200K iterations the memory footprint is as follows:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
29684 ofer 20 0 813.3m 161.8m 7.1m S 0.0 2.0 0:03.29 node
The code is available in this gist
Node version: 0.12.7
The text was updated successfully, but these errors were encountered: