• Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpUrlConnection leaves connections in CLOSED_WAIT state

 
Gary Hirschhorn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!