commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Melhem <>
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();, os);

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

Note we use the 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!!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message