You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Elihu Smails <el...@gmail.com> on 2005/03/24 14:40:14 UTC

commons-fileupload memory problem

I am trying to use the commons-fileupload classes and cannot figure
out how to keep my uploads from getting stored in memory.  I am using
the following methods:

DefaultFileItemFactory fileItemFactory = new DefaultFileItemFactory(
10, new File("/tmp") );
DiskFileUpload upload = new DiskFileUpload( fileItemFactory );

When I run tomcat using JDK 1.5's jconsole program and upload a file,
my memory usage jumps to about 10x the size of the attachment.

Has anyone else used the library successfully?  

TIA.

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


RES: commons-fileupload memory problem

Posted by Paulo Alvim <al...@powerlogic.com.br>.
We had the same problem and after debugging a few commons-fileupload classes
(and Struts RequestProcessor) we could find that 250-500K of RAM was being
used per "request property" (in "multipart" form, an object is created for
each form field!).

Since our form had the FormFile field plus 35 "ordinary" others...our
request was consuming 20MB!

We don't know the reason yet...so we had to isolate the FormFile field in a
separated web-page...maybe we could use two form in the same page with the
same result.

Paulo Alvim
Powerlogic - Brazil

-----Mensagem original-----
De: Elihu Smails [mailto:elihusmails@gmail.com]
Enviada em: quinta-feira, 24 de março de 2005 10:40
Para: Tomcat Users List
Assunto: commons-fileupload memory problem


I am trying to use the commons-fileupload classes and cannot figure
out how to keep my uploads from getting stored in memory.  I am using
the following methods:

DefaultFileItemFactory fileItemFactory = new DefaultFileItemFactory(
10, new File("/tmp") );
DiskFileUpload upload = new DiskFileUpload( fileItemFactory );

When I run tomcat using JDK 1.5's jconsole program and upload a file,
my memory usage jumps to about 10x the size of the attachment.

Has anyone else used the library successfully?

TIA.

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



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