-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Release memory used by PerMessageDeflate extension #608
Conversation
👍 awesome But I'm not sure if this is the root cause, since zlib objects should be released with socket instances when no reference exists. |
@nkzawa hi! that's what I thought too, but running the following gist seems to show a different behaviour
Meanwhile, the HeapSize goes up and down (which is normal, as GC runs). Are you able to reproduce my results? Or is there a problem with my test? I mean, the extra memory is normal, as it comes as a cost for compression (as said here). But as said here (that's a lot of links 😄), memory has to be deallocated by calling But it may not be the root cause (and that's where I need your help). Note: |
Hi, sorry for the delay. I could reproduce similar results with your scripts, but maybe this means it's not leak? Though I have no idea about the difference of RSS. |
You're right, the term 'leak' was probably wrongly used here, please excuse me. I found this nodejs/node-v0.x-archive#4172. Could this be related and explain the difference in RSS? (as we are now explicitly calling .close()) Source: https://github.com/nodejs/node/blob/master/src/node_zlib.cc#L97 |
@3rd-Eden can you merge please? |
PR will be adressed this week. Sorry for the hold up. |
Great, thanks! |
Release memory used by PerMessageDeflate extension
Maybe this issue is still at #804 . |
Hi! It seemed the memory allocated by perMessageDeflate is not properly freed, thus causing memory leaks when this feature is enabled (as reported here #497)
As documented here and implemented here, calling
.close()
on DeflateRaw and InflateRaw objects should (at least partially) fix these leaks.Related: socketio/socket.io#2251
(please tell me this is it)