HttpURLConnection.getOutputStream() returns ChunkedOutputStream when setChunkedStreamingMode(4k) is called. But ChunkedOutputStream copies when write(byte, off, len) is called. When ChunkedOutputStream.write(buf[20MB], off, len) is called, it keeps a copy of 20 MB. Thus, applications run of memory. There is no need to keep 20 MB in buf field since the chunk size 4k. This limits severly some of the JAX-WS applications and forces JAX-WS to do chunking before writing to ChunkedOutputStream. The fact that we are using chunking to avoid buffering doesn't help.