Dev iconDevSep 4, 2026 ~1 min source read

Streaming Large HTTP Responses Without Killing Your Memory

πŸ‘‹ Ever downloaded a 500MB file with HttpClient and watched your app's memory balloon? Buffering Everything By default, HttpClient buffers the entire response in memory: // 😱 This loads EVERYTHING into memory!

Streaming Large HTTP Responses Without Killing Your Memory

Share this story

Send the public story page.

Useful takeaways from this story.

πŸ‘‹ Ever downloaded a 500MB file with HttpClient and watched your app's memory balloon?

Buffering Everything By default, HttpClient buffers the entire response in memory: // 😱 This loads EVERYTHING into memory!

The default HttpClient.MaxResponseContentBufferSize is 2GB on 64-bit systems.

Building the complete brief

The page is ready to read now. The fuller skim-friendly version will appear here automatically.

The useful part

πŸ‘‹ Ever downloaded a 500MB file with HttpClient and watched your app's memory balloon? Buffering Everything By default, HttpClient buffers the entire response in memory: // 😱 This loads EVERYTHING into memory! The default HttpClient.MaxResponseContentBufferSize is 2GB on 64-bit systems.

Details worth keeping

You can hit OutOfMemoryException before you even realize what's happening! GetAsync ("https://example.com/huge-file.json", HttpCompletionOption.

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app