-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix for slab buffer retention, leading to large memory consumption #370
Conversation
Putting this on hold as I believe that a node core fix is the most appropriate. Buffer can also retain an 8k slab on it's own, ideally node core should emit a buffer that is not backed by any slab. |
@jmatthewsr-ms I'm reopening after @3rd-Eden bought it to my attention because because it appears the fix for underlying issue in node core was not resolve. Is this correct? |
Yes. My understanding is that this won't be fixed until possibly 0.12: |
You're correct. It will probably take the entire v0.11 development cycle to vet the new allocator. Also note that it currently just mirrors the way Buffers pool data. The first step is just to get the thing working. This will require a substantial overhaul. Then once everything is allocating from the same source we can focus on improving the allocation algorithm. |
I'd advise us to accept this pull request. I've been doing a lot of WebSocket proxy tests lately because I was interested in to seeing how our proxy solution compares to other proxies such as I've deployed the proxy on a 512mb joyent virtual machine running the latest ubuntu and hit it using observing/thor with:
I saw a peak memory of |
Re-ran the test suite and everything is passing now, it was probably a failure on travis side that marked these commits as broken. |
Note that this is being worked on in node core: nodejs/node-v0.x-archive#4964. The buffer copy in this fix may not be required once node core buffer is fixed. The fix here shouldn't hurt performance if left in, but worth checking once node core is updated. |
@jmatthewsr-ms yes, it's being worked on but it would only be made available in node 0.12, which still another stable release away and as we have no idea how long it will take before 0.12 is released, it makes sense to merge this in IMHO (as well as in all other projects). |
Agreed. |
Fix for slab buffer retention, leading to large memory consumption
See: https://github.com/jmatthewsr-ms/node-slab-memory-issues