tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46075] New: FileUpload memory usage
Date Thu, 23 Oct 2008 10:35:54 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46075

           Summary: FileUpload memory usage
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet & JSP API
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: rich@bitwise-systems.com


The DefaultFileItem class in pacakge org.apache.tomcat.util.http.fileupload
creates a ByteArrayOutputStream of the full threshold size for every control on
the submitted form. I have a form with 63 controls (checkboxes, text boxes and
one File input), and I set the threshold to 20 Meg to allow upload of large
image files into memory. I get an OutOfMemory exception since it tries to
allocate 63 lots of 20M, although only 1 control requires the requested size.

I think it would be much more sensible to create the ByteArrayOutputStream with
an initial size of only a few kilobytes size it automatically increases its
size as data is written to it.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message