JDK-6518816 : Reduce the memory foot print for HttpURLConnection
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-01-29
  • Updated: 2010-04-03
  • Resolved: 2007-06-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u2Fixed 7Fixed
Description
Some of the JAX-WS applications send a lot of data in web service requests. JAX-WS uses HttpURLConnection to send the web service request. All this data is buffered in sun.net.www.http.PosterOuputStream and it remains until URLConnection is GCed. JAX-WS keeps a referece to URLConnection (even after it reads the response) to compute cerain things(for e.g: HTTP headers) lazily using URLConnection. There is no use to keep this PosterOuputStream once the request is sent. We would want the reference to PosterOuputStream to be set null at an appropriate place and thus it will reduce the memory footprint.

Comments
SUGGESTED FIX Can set the output streams to null safely just before HttpURLConnection.java:1248 where the input stream is returned to the application.
28-02-2007

EVALUATION Seems like a reasonable request. Will fix in 7 first, and then back-port.
28-02-2007