glassfish
  1. glassfish
  2. GLASSFISH-18505

OutOfMemory while uploading one file with the Vaading Upload component

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2_b23
    • Fix Version/s: 4.0_b77
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Description

      The sample application works fine with glassfish V3.1.1 b12, but not with V3.1.2 b23.

      Steps to reproduce:

      1. Install glassfish V3.1.1 b12
      2. Deploy attached war
      3. Start web-app in a browser:
      3.1. Open URL http://127.0.0.1:8080/TestVaadinTest/
      3.2. Choose a image files and press ok (Attention: may be there must be the dir "/tmp/uploads/" existing?!?)
      3.3. Image file will be uploaded and displayed
      4. Update glassfish to version V3.1.2 b23
      5. restart the web-app
      5.1. Open URL http://127.0.0.1:8080/TestVaadinTest/
      5.2. Choose a image files and press ok
      5.3. After just few seconds a OutOfMemory occurred:

      INFO: ________________ INIT APP

      WARNUNG: StandardWrapperValve[c-onDocFlowVaadin]: PWC1406: Servlet.service() for servlet c-onDocFlowVaadin threw exception
      java.lang.OutOfMemoryError: Java heap space
      at java.util.Arrays.copyOf(Arrays.java:2271)
      at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
      at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
      at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:122)
      at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.readLine(AbstractCommunicationManager.java:386)
      at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUpload(AbstractCommunicationManager.java:427)
      at com.vaadin.terminal.gwt.server.CommunicationManager.handleFileUpload(CommunicationManager.java:257)
      at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:495)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

      The size of the uploading image file I used is 17KB. Increasing memory ("-Xmx", "-Xms" and "-XX:MaxPermSize") has no effects.

      The attached web application works also with JBoss 7.1.1 and tomcat 6.0.20 without problems (tested on these both server).

      Some effect while file uploading (work in 3.1.1 B12 but not in 3.1.2 b23), but other exception like in #GLASSFISH-18504. May be related.

      1. UploadExampleApplication.java
        4 kB
        stewert

        Issue Links

          Activity

          Hide
          bantunes added a comment - - edited

          Performing a thread dump during the upload we have:

          "http-thread-pool-8080(3)" daemon prio=10 tid=0x00007feff402a000 nid=0x76a7 runnable [0x00007ff02c439000]
             java.lang.Thread.State: RUNNABLE
                  at java.util.Arrays.copyOf(Arrays.java:2786)
                  at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)
                  - locked <0x00000007800c7e40> (a java.io.ByteArrayOutputStream)
                  at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.readLine(AbstractCommunicationManager.java:386)
                  at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUpload(AbstractCommunicationManager.java:427) 
          ...
          
          Show
          bantunes added a comment - - edited Performing a thread dump during the upload we have: "http-thread-pool-8080(3)" daemon prio=10 tid=0x00007feff402a000 nid=0x76a7 runnable [0x00007ff02c439000] java.lang. Thread .State: RUNNABLE at java.util.Arrays.copyOf(Arrays.java:2786) at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71) - locked <0x00000007800c7e40> (a java.io.ByteArrayOutputStream) at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.readLine(AbstractCommunicationManager.java:386) at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUpload(AbstractCommunicationManager.java:427) ...
          Hide
          bantunes added a comment -

          This problems is probably related with the issues:

          In order to solve/workaround the reported problem, replace in GlassFish 3.1.2 the file $GLASSFISH/modules/web-core.jar with the one attached in the issue GLASSFISH-18444

          Show
          bantunes added a comment - This problems is probably related with the issues: GLASSFISH-18444 "Incompatibel breaking changes to getParameter() / getPart() probably for Ticket GLASSFISH-16740 "; GLASSFISH-16740 "Unable to get "multipart/form-data" request parameters by HttpServletRequest#getParameter" In order to solve/workaround the reported problem, replace in GlassFish 3.1.2 the file $GLASSFISH/modules/web-core.jar with the one attached in the issue GLASSFISH-18444
          Hide
          bantunes added a comment -

          Related issue on Vaadin

          Upload file in Vaadin using Glassfish 3.1.2 cause OutOfMemoryException
          http://dev.vaadin.com/ticket/8620

          Show
          bantunes added a comment - Related issue on Vaadin Upload file in Vaadin using Glassfish 3.1.2 cause OutOfMemoryException http://dev.vaadin.com/ticket/8620
          Hide
          shreedhar_ganapathy added a comment -

          -> Shingwai for eval and release targetting.

          Show
          shreedhar_ganapathy added a comment - -> Shingwai for eval and release targetting.
          Hide
          Amy Roh added a comment -

          GLASSFISH-18444 is fixed in 3.1.2.2 and I verified that this is working as expected in the trunk.

          Show
          Amy Roh added a comment - GLASSFISH-18444 is fixed in 3.1.2.2 and I verified that this is working as expected in the trunk.

            People

            • Assignee:
              Amy Roh
              Reporter:
              stewert
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: