commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Melhem <micha...@managesoft.com>
Subject [VFS] OutOfMemory Exception on large files
Date Wed, 08 Jun 2005 12:29:05 GMT
Hi Guys,

We have a problem with the DefaultFileContent-OutputStream upon handling 
of large files. We get an OutOFMemory Exception on any upload of a file 
 > than approx 13 Meg, but never happens on the download (ie 
inputstream) of the same file.

The Exception happens with the latest VFS code from svn, plus all 
earlier snap shots I have tried.

We are using HTTP protocol. We have code something like this (in a 
simple junit test):-

...
final FileObject toDownload = fsManager.resolveFile(sourceURI.toString());
final InputStream is = toDownload.getContent().getInputStream();

final FileObject toUpload = fsManager.resolveFile(targetURI.toString());
final OutPutStream os = toUpload.getContent().getOutputStream();


org.apache.commons.io.IOUtils.copy(is, os);

os.close() // this close will always cause an OutOfMemory Exception 
(when file is approx larger than 13 M on our system)
is.close()
...

Note we use the commons.io.IOUtils for the copy which handles 
stream-copy using 4k buffers AFIAK, so i dont think the problem is there.

Any help on this will be much appreciated!!

Regards,
Michael

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


Mime
View raw message