I'm writing a large response (hundreds of Mb) to the WebSphere's response.getOutputStream(). It appears that Web Sphere always store whole output stream data in some internal in-memory buffers before serving it to the cient. So my servet processing (generating data) finishes in seconds while browser may still be downloading it for half an hour. During that time whole response remains buffered in memory.
Is it possible to avoid this buffering? I'd prefere more servlet threads waiting for the output stream than wasting Gbs of memory.
My Web Sphere version is 8.5.0.
I've tried setting content length and chunked response - it's all the same, still buffering. My TCP transport chain settings are default with 32 kb response buffer, but it is ignored somehow.
Are you sure that this data is stored by Websphere in an internal in-memory buffer? The Websphere channel output buffer can only hold 32K of data at a time. So the remaining data is probably held by your servlet, since you have generated some big data stored in the heap and referenced by your code.
Take a look at your code and see what data your code is referring, and if you want to know what is stored in memory and who is keeping it alive, take a snapshot of the heap (a heap dump).
Meanwhile the answer was found among WAS web container custom properties.