hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: Performance issues in ChunkedInputStream
Date Wed, 11 Apr 2007 15:52:06 GMT
Hello Tony,

> I
> have tried making the BufferedInputStream in HttpConnection large (128K)
> and it still fills up (it just takes a little longer).
> [...] 
> One other issue I have with that code is if I interrupt the file
> transfer and call method.abort(), that ChunkedInputStream appears to
> still keep pulling data from the host.

As Oleg pointed out, the socket and it's I/O streams are closed by
method.abort(). The streams residing on top of that will not be closed.
The ChunkedInputStream sits on top of the BufferedInputStream that
was created by the connection. As long as there is data in the buffer,
the stream will continue to work. Only when the buffer is exhausted,
a new call to the socket stream is made. That call will then result
in an IOException indicating that the socket has been closed. In
other words, CIS is pulling data from the buffer, not from the host.

I wonder how the BufferedInputStream can fill up. If it is empty,
a single attempt will be made to read data from the underlying
socket stream. Then, only the buffered data is accessed until that
is exhausted. Does your OS buffer enough data on it's own to fill
a 128 K buffer in a single read operation? If it does, I wonder
even more why parsing the chunk header should be a performance
bottleneck. Is there suspicious GC activity?

cheers,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message