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.
|