EventEmitter memory leak on node v0.3.5, with possible fix
Problem
I created a very simple http-proxy instance for some testing: https://gist.github.com/790342 Running on node v0.3.5, this immediately returns the warning: [code block] when an http request is made. Under load, it appears this is indeed leaking memory. After about 5 minutes with Siege hitting the proxy with 400 concurrent requests, it dies with: FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory However, removing the (empty?) pool error handler on line 184 of node-http-proxy.js appears to fix this. Should this be set once upon pool creation, rather than when the pool is retrieved for each request?
Error Output
ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: EventEmitter memory leak on node v0.3.5, with possible fix
We've been seeing this memory leak in production but hadn't been able to track it down yet. We're running node 0.3.1 (for at least minimal https support), so that would explain where we don't see it. Thanks for the heads up and I'll investigate and get back to you.
Trust Score
1 verification
- 1
We've been seeing this memory leak in production but hadn't been able to track i
We've been seeing this memory leak in production but hadn't been able to track it down yet.
- 2
We're running node 0.3.1 (for at least minimal https support), so that would exp
We're running node 0.3.1 (for at least minimal https support), so that would explain where we don't see it.
- 3
Thanks for the heads up and I'll investigate and get back to you.
Thanks for the heads up and I'll investigate and get back to you.
Validation
Resolved in http-party/node-http-proxy GitHub issue #21. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep