| Author |
HttpUrlConnection leaves connections in CLOSED_WAIT state
|
Gary Hirschhorn
Greenhorn
Joined: Jun 22, 2004
Posts: 2
|
|
Our java application fetches pages from various websites. One of our customers is finding that their machines have a very large number of TCP/IP connections in CLOSED_WAIT states that are remaining for long periods of time. We have not been able to reproduce this -- any thoughts?
I have attached our basic processing code (with non-relevant code removed). We are running on Microsoft Windows Server 2003 and using Java 6 and the java.net.HttpURLConnection class. For each connection, we close the input stream after reading it, but do not disconnect, so that Java can re-use the connection. This normally produces many connections with TIMED_WAIT states, but only an occasional short-lived CLOSED_WAIT state.
|
 |
Tim McGuire
Ranch Hand
Joined: Apr 30, 2003
Posts: 819
|
|
There is a bug report
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6215050
related to this. It seems to exactly match what you describe.
can you find out what version of java that particular customer is using?
|
 |
Gary Hirschhorn
Greenhorn
Joined: Jun 22, 2004
Posts: 2
|
|
|
Thanks for the reply. I saw that bug report, but we are using Windows, Java 6 update 3. It seems the bug only applies to Linux and there are only complaints for Java 5 and earlier.
|
 |
 |
|
|
subject: HttpUrlConnection leaves connections in CLOSED_WAIT state
|
|
|