How to catch a probable false alarm
diorahman opened this issue · 3 comments
This is actually a really nice module. Thanks!
I have set up a small experiment here: https://github.com/diorahman/send
However, I'm not sure if the http.Agent
with keepAlive: true
is supposed to be leaking all the time.
If I set the keepAlive as https://github.com/diorahman/send/blob/master/fetch.js#L12 it leaks, however if I set it false it doesn't.
What do you think?
Thanks!
Hey @diorahman.
Yeah, that makes sense. The connection pool will keep growing until it reaches some limit, thus growing the heap.
I think it should not leak if you .destroy()
the agent at the end of the iteration. Or maybe you can create the agent before starting to iterate, set it's maxFreeSockets
option to a low value and open connections until the pool is filled before you start iterating.
Yes, you're right. I need to set the maxFreeSockets
to a small number to let it pass. Thanks!