You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Anthony Oganesian <ao...@gmail.com> on 2007/01/04 20:42:56 UTC

reusing FileUpload objects in the servlet

Hi,
I am trying to optimize my servlet which uses FileUload for a heavy
load and would greatly appreciate any suggestions. Specifically, I
wonder if it is possible (advisable) to instantiate some of the
FileUload objects as static (e.g. DiskFileItemFactory)

Thanks a lot in advance,
Tony.

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


Re: reusing FileUpload objects in the servlet

Posted by Martin Cooper <ma...@apache.org>.
On 1/4/07, Anthony Oganesian <ao...@gmail.com> wrote:
>
> Hi,
> I am trying to optimize my servlet which uses FileUload for a heavy
> load and would greatly appreciate any suggestions. Specifically, I
> wonder if it is possible (advisable) to instantiate some of the
> FileUload objects as static (e.g. DiskFileItemFactory)


If you are just using FileUpload "out of the box" (i.e. without adding your
own custom classes), I wouldn't bother trying to cache instances of the
FileUpload classes. The instantiation cost is insignificant. You'd be better
off spending your time optimising the threshold between memory and disk
storage for your particular scenario.

--
Martin Cooper


Thanks a lot in advance,
> Tony.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>