George We had problems with threads leakage too. Please read further ONLY if you are looking at "threads leakage "
Apologies if not :) We modified the code to use ONE httpClient object with MultiThreadedConnectionManager for our entire application Used HttpClient V3 & the problem seemed to have disappeared. Use "Connection: close" header only if you want your connection to be closed/non-persistent. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 Don't know for sure whether this will return the connection the MultiThreadConnMgr's pool HTH Regards, Jaya. -----Original Message----- From: George Ludwig [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 12:54 AM To: HttpClient User Discussion Subject: Re: HttpClient seems to hang on SocketNativeIO.read Roland, Thanks for the response. I'd been searching the archives for a bit, and discovered a couple of things: 1. I set the "Connection: close" header. That seemed to help. 2. I set the linger value to 4000. That also seemed to help. Right now, I'm not seeing any stuck download threads...but the day is young! Best, George --- Roland Weber <[EMAIL PROTECTED]> wrote: > Hello George, > > it looks like your message somehow fell through the cracks. > Sorry for the late response. > > > "ThreadPool-Crawler DownloadJob > > PooledThread-1-running" id=436 idx=0x62 > > tid=-1569055552 prio=5 alive, in native, daemon at > > jrockit/net/SocketNativeIO.read(IIII)I(Native > Method) > > at > jrockit/net/SocketNativeIO.read(Ljava/io/FileDescriptor;III)I(Unknown > Source)[inlined] > > at java/net/AbstractSocketImpl$1.read(II)I(Unknown > Source)[optimized] > > ^-- Holding lock: > > java/net/[EMAIL PROTECTED] > lock] > > at > jrockit/io/NativeIOInputStream.read(I[BI)I(Unknown > Source)[inlined] > > at > jrockit/io/NativeIOInputStream.read([BII)I(Unknown > Source)[optimized] > > at > java/io/BufferedInputStream.fill()V(BufferedInputStream.java:218)[inline d] > > [...] > > My socket timeout is set to 54 seconds, so I don't understand why > > these sockets go off into space for many hours, never to come back. > > Well, your sockets seem to be jrockit specific ones. > Maybe there is a bug in the socket implementation? > Depending on the Java version, HttpClient implements some socket > timeouts by spawning a timout thread which eventually interrupts the > blocked thread after the timeout. If jrockit sockets do not unblock > the thread in that case, there is the explanation. With JDK 1.4, the > timeout is set at the socket itself. > > I suggest you enable HttpClient logging. In your case, you probably > don't need the wire log to understand what is going on. > > hope that helps, > Roland > > > > > > Here's my HttpClient initialization code: > > > > static { > > HttpConnectionManagerParams connMgrParams = > > new HttpConnectionManagerParams(); > > connMgrParams.setConnectionTimeout(4000); > > connMgrParams.setSoTimeout(4000); > > connMgrParams.setMaxConnectionsPerHost( > > HostConfiguration.ANY_HOST_CONFIGURATION,1); > > connMgrParams.setMaxTotalConnections(300); > > MultiThreadedHttpConnectionManager connMgr = > > new MultiThreadedHttpConnectionManager(); > > connMgr.setParams(connMgrParams); > > httpClient= new HttpClient(connMgr); } > > > > I also noticed in the jrockit memory leak tool > that > > even though I set ignoreCookies to be true before every call, I > > still acumulate thousands of then. > Is > > this normal? > > > > Cheers, > > > > George > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ********************************************************* Disclaimer: The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT. This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use ********************************************************* --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
