Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.2.2
-
None
-
None
-
Fedora 15. Tomcat 6.
Description
When processing a large number of multipart uploads, new byte buffers are created for every part of every request. It would be preferable if the servlet could reuse those buffers for the next request. Failing that, it would already be an improvement if FileUploadBase.findNextItem() could pass the same buffer to subsequent calls of MultipartStream.skipPreamble() and discardBodyData().
The item iterator would need two temporary buffers. One would be passed to MultipartStream via a new constructor. The other would be passed to readBodyData(), discardBodyData(), and skipPreamble() to be passed on to Streams.copy().
This change would require additional signatures for five methods constructors and methods but it would reduce memory allocation by a noticeable amount.