You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using this module to track what is pending in my nodejs project, and once my node process ended with heap out of memory, I was confused a lot by checking my code for memory leak...
Finally with ChromeDev tools, I found that the objects Array, Promise & PromiseWrap were always increasing without being released by GC, and they're somehow related to this module.
By checking the source code, async-hook was used to track all the Promises/async/await, and they're put into a map... so I think that's where the leak happens. and after removed require('why-is-node-running') from my code, the memory leak was gone.
So maybe I would like to recommend to put some WARNINGS in the README.md file of this module like:
if you're creating new Promises to wrap traditional callbacks a lot, this module could lead to memory leaks...
Thanks.
The text was updated successfully, but these errors were encountered:
I think this issue surfaces when using HTTPS agents with keepalive.
I'm writing a site cloner where I'm encountering a scenario with 60,000+ TLSWrap and ZLIB handlers reported. I definitely do not have that many open connections.
For larger sites, I get OOM failure. I tried removing why-is-node-running and the OOM went away.
Could it be related to this issue as well? nodejs/node#33468 I'm running Node 12.8.2.
Hello guys,
I was using this module to track what is pending in my nodejs project, and once my node process ended with heap out of memory, I was confused a lot by checking my code for memory leak...
Finally with ChromeDev tools, I found that the objects Array, Promise & PromiseWrap were always increasing without being released by GC, and they're somehow related to this module.
By checking the source code,
async-hook
was used to track all the Promises/async/await, and they're put into a map... so I think that's where the leak happens. and after removedrequire('why-is-node-running')
from my code, the memory leak was gone.So maybe I would like to recommend to put some WARNINGS in the
README.md
file of this module like:if you're creating new
Promises
to wrap traditional callbacks a lot, this module could lead to memory leaks...Thanks.
The text was updated successfully, but these errors were encountered: