-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
http: free parser on keepalive #33167
Conversation
Free parser when putting socket back in the agent keep alive free list. Fixes: nodejs#29394
@@ -712,10 +699,19 @@ function emitFreeNT(req) { | |||
} | |||
|
|||
if (req.socket) { | |||
freeSocket(req, req.socket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the significant change.
@ronag unfortunately the problem is still there... Looks like the problem is connected to Now, I have some concerns that the free list is running the constructor when the HTTPParser is allocated from the free list and not when it is put back into the free list for reuse. I'm also confused by why the code below isn't merged with
After adding the Similar situation but different retainer. In this case it's the Echoing my original comment about whether it is truly meaningful to pool the HTTPParser. There's a lot of complexity here that goes away if we do not pool HTTPParser objects. In summary, the memory leak goes away if we add these two lines to the
|
@leidegre Good digging there. I would add that comment to the original issue. I would not object to remove the pooling but I'm not sure about its performance implications. |
@nodejs/http This PR does not solve the references issue. Is it still worth trying to land or should we close it? |
@leidegre Would you mind opening a PR with this change? |
@ronag I'll open a PR. I think I did mention it in my first comment but I can reiterate my fidings here the as well put emphasis on whether the pooling is necessary. |
Fixes: #29394 Refs: #33167 (comment) PR-URL: #33190 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Fixes: #29394 Refs: #33167 (comment) PR-URL: #33190 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Fixes: #29394 Refs: #33167 (comment) PR-URL: #33190 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Free parser when putting socket back in the agent keep alive free list.
Fixes: #29394
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes