commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject Re: fileupload makes tomcat 5.5 unresponsive for other users
Date Wed, 25 Oct 2006 17:06:52 GMT
Are you saying that Tomcat isn't responding to any other of the same type of
requests (other file uploads) or it's not responding to *any* requests at
all (even requests to other webapps within the same instance)?

On 10/25/06, Richard Koch <richk@talkshoe.com> wrote:
>
> I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
> <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
>
>
>
> When a user uploads a file, tomcat becomes completely unresponsive to any
> other requests until the upload is complete-this is the case no matter
> what
> the file size is 8K to 40MB.
>
>
>
> Watching garbage collection logging details, I see that the file upload
> component always seems to take at least 32MB or 42MB, and then it is
> quickly
> collected when the upload is completed, and the tomcat server is then
> available to everyone.
>
>
>
> I used the input stream from the
> org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call,
> and
> then write it out using the below method.
>
>
>
> Any ideas what would be causing tomcat to be non-responsive to any other
> request until the upload is finished?  Are there any configuration tweeks
> that can made to help.  I have scanned the mail archives, wiki, and
> documentation without luck.  Perhaps I have missed something?
>
>
>
> Thanks.
>
>
>
> Rich K.
>
>
> ----------------------------------------------------------------------------
>
> ----------------------------------------------------------------------------
> ---------------------------------------------------
>
>
>
>       /**
>
>        * Write the given input stream to the given file identified by the
> targetFilePath string.
>
>        * @param inputStream
>
>        * @param targetFilePath
>
>        * @throws IOException
>
>        */
>
>       public static void writeInputStreamToFile(InputStream inputStream,
> String targetFilePath) throws IOException {
>
>         InputStream in =
>
>             new BufferedInputStream(inputStream);
>
>         OutputStream out =
>
>             new FileOutputStream(targetFilePath);
>
>         try {
>
>             byte[] buffer = new byte[64 * 1024];
>
>             int count;
>
>             while ((count = in.read(buffer)) > 0) {
>
>                   out.write(buffer, 0, count);
>
>             }
>
>         } finally {
>
>             in.close();
>
>             out.close();
>
>         }
>
>       }
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message