You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Robert Campbell <rr...@gmail.com> on 2009/11/07 17:24:09 UTC

OutOfMemoryError when using FileUpload's DiskFileItem

I am getting OutOfMemoryErrors when uploading large (>300MB) files to
a servlet utilizing Commons FileUpload 1.2.1. It seems odd, because
the entire point of using DiskFileItem is to prevent the (possibly
large) file from residing in memory. I am using the default size
threshold of 10KB, so that's all that should ever be loaded into the
heap, right? Here is the partial stack trace:

java.lang.OutOfMemoryError
	at java.io.FileInputStream.readBytes(Native Method)
	at java.io.FileInputStream.read(FileInputStream.java:177)
	at org.apache.commons.fileupload.disk.DiskFileItem.get(DiskFileItem.java:334)
	at org.springframework.web.multipart.commons.CommonsMultipartFile.getBytes(CommonsMultipartFile.java:114)

Is there some configuration I'm missing? Any tips/tricks to avoid this
situation?

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