-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Memory leak on large files with streaming middleware union #138
Comments
I'm seeing the same thing here. Requesting/streaming a large file (ex: a movie) will make it consume Gbs of memory. If I request the same file again the memory usage will double. Doesn't seem to be released, in the end the node process is killed by the OS when it runs out of available memory. |
+1 I'm having the same issue when trying to transfer big files from devices with low-memory (like the Raspberry Pi). Couldn't be related to this the issue? http://stackoverflow.com/questions/15001822/sending-large-image-data-over-http-in-node-js |
Pull request flatiron/union#55, but seems this project is not maintained any more, a new dependency should be chosen. |
Yes. |
I'd be happy to do this. One solution might be to just use Express for the middleware-like behavior. A more lightweight solution might be to used middl. What do you think? |
Problem persists on http-server 0.9.0 and node 6.7.0. Which is too bad, as otherwise this is a great little tool. Have to use HFS instead (http://www.rejetto.com/hfs/?f=dl). :( (For some reason HFS is faster as well, by about 20%.) |
This should be fixed with in |
Is this confirmed fixed? Can this issue be closed? |
I just tried transferring a huge file after running http-server 0.11.1 with no special command-line arguments and the memory usage stayed reasonable throughout. I don't know whether this answers the question, since there is no example code in this ticket and I don't know if |
|
We will eventually be removing |
Union is not actively developed anymore, see [1]. Union provides a middleware capability similar to connect [2] supporting buffered streams and providing some convenience APIs on top of the middleware capability. However, the stream functionality offered by union is already available since Node.js v0.12 [3] and Tabris CLI does not use most of the APIs union offered. Migrate middleware handling to connect. Opt for connect instead of express, since Tabris CLI does not use most of the extra features express offers and express comes with significantly more external dependencies (currently connect 4 vs express 30). Error handling notes: * connect errors do not have a status field. Only log the error message. * connect does not handle 404 as an error as union did. Restore this behavior by using an extra middleware to catch all unhandled requests and treat them as errors. [1]: http-party/http-server#138 (comment) [2]: https://www.npmjs.com/package/connect [3]: flatiron/union#61 (comment) Fix #71 Change-Id: If502571e61f53098afd6cbfbfa66e8053691eeda
This issue has been inactive for 180 days |
I'm trying to serve large files(1 GiB) using http-server, the memory usage is abnormally high, so I got the heap profile and saw lots of 65535 KiB Buffer without being GCed.
But when I switch to connect instead of union, everything is all right then, so I'm pretty sure that something wrong is happening in union.
http-server v0.7.5
node v0.10.32
The text was updated successfully, but these errors were encountered: