commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: [VFS] OutOfMemory Exception on large files
Date Thu, 09 Jun 2005 21:48:08 GMT

--- Mario Ivankovits <mario@ops.co.at> wrote:

> Hi Torsten!
> >Michael came up with a workaround. Instead of
> >using a ByteArrayOutputStream we use a temp
> >file and a FileOutputStream.
> Nice idea!
> 
> >He is currently looking into a Piped version.
> >Or what do you think how should we solve this?
> >  
> I think a Piped version is the correct solution.
> 
> But please have a look at the perfomance also.
> As I said the jdk Piped*Stream use an internal
> buffer of 1k. When I try 
> to use the piped version in jsch (sftp) it gets dog
> slow.
> I blamed the JDK implementation of the pipe for
> this, though I havent 
> investigated into this any further.
> But maybe we also nead our own implementation of
> Pipe-Streams.

FYI it looks a little hacky perhaps but Ant's codebase
has org.apache.tools.ant.util.LeadPipeInputStream that
a) doesn't die just because its writing Thread has
died, and b) allows you to specify (or change while in
use) the buffer size.

-Matt



		
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html

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


Mime
View raw message