felixge/node-combined-stream — pull request #12 by andyhu (2014-05-17 02:53:09+00:00)
Title: Fix the memory leak issue when attaching large streams

See mikeal/request#898

When attaching a large file (or any other readable stream), and the write stream is much slower than the read stream , it will make the entire content of the file to be loaded into memory, which causes huge memory leak (In my case it consumes more than 600M rss and created more than 20,000 Buffer objects which cannot be GCed when attaching a 600M file stream and pipe it to request upload.)

I've added couple of lines to make sure when it's paused, it should not be writable, it seems fixed the problem.