FG
💻 Software📡 Networking

EventEmitter memory leak on node v0.3.5, with possible fix

Freshabout 15 years ago
Mar 14, 20260 views
Confidence Score85%
85%

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

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: EventEmitter memory leak on node v0.3.5, with possible fix

Low Risk

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.

84

Trust Score

1 verification

100% success
  1. 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. 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. 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

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

proxyhttpnode.js