Skip to content
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

IgnitedHttpResponseImpl relies on BufferedHttpEntity which blows up memory limits for large entities #48

Open
robertoandrade opened this issue Jul 1, 2013 · 1 comment

Comments

@robertoandrade
Copy link

When trying to consume a large entity via IgnitedHttpResponseImpl it seems like the replacement of the original entity by a BufferedHttpEntity in its implementation seems to allocate memory for the the entire length of the entity you're trying to download.

So say you have a 100MB file for instance, it will try to allocate that much memory to fetch the InputStream of the HttpEntity (which by the name - buffered - you'd expect it to stream the contents via an internal buffer or sorts rather than cache the entire stream).

Do you guys have any suggestions to overcoming this issue given AbstractHttpClient seems to call entity.consumeContent() right after the initialization of the response by IgnitedHttpRequestBase.handleResponse()?

@zabawaba99
Copy link

I'm having a similar issue in where I'm expect a HttpResponse with an entity that has a content length of 125 MB. As IgnitedHttpRequestBase.handleResponse() is called, the BufferedHttpEnity allocated 125MB worth of memory for the application and causes an outOfMemoryException.

Is there any plan to change the implementation in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants