-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Possible memory leak when calling uv_queue_work from an addon multiple times #3560
Comments
Another report on the same issue without NAN http://stackoverflow.com/questions/33346385/how-can-i-use-uv-queue-work-multiple-times |
Why do you report it here and not at https://github.com/nodejs/nan? |
Also, why are you trying to start one billion asynchronous work items? Small wonder it runs out of memory.
What do you think this is? From your gist: Callback *callback = new Callback(info[0].As<Function>());
AsyncQueueWorker(new AsyncTestWorker(callback)); I'll close the issue, I don't see a bug here. |
It was here too: nodejs/nan#501 but there is no reason it would leak from NAN's pov. |
Thanks @kkoopa and @bnoordhuis, it was my mistake the loop keeps creating new AsyncQueueWorker (threads) without waiting for the previous workers to complete and this of course is the reason for the memory issue. |
No problem. I think you posted to the libuv mailing list earlier this week, didn't you? Maybe you can post a follow-up? |
@bnoordhuis I was the one who posted to the libuv mailing list last week. Already posted a follow-up. This is not a bug. As @kkoopa said, AsyncQueueWorker deletes the worker after it has been executed. Thanks for the help! |
I've created a minimal asynchronous addon based on NAN example 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 ~15 sec it crashes with:
Also tried running twice with 2K iterations the memory footprint is as follows:
This is the output after the first round:
The code is available in this gist
Node version: 0.12.7
The text was updated successfully, but these errors were encountered: