Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10399

OutOfMemoryError: Java heap space when sending large file to endpoint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.3, 2.18.0
    • 2.18.1, 2.19.0
    • camel-jetty
    • None
    • Debian inside docker container

    • Unknown

    Description

      My route and jetty configuration:

      <route id="ds-rest-archive-upload-processor">
      <from uri="jetty:https://storage:8443/data/archive?sslContextParametersRef=sslContextParameters&amp;requestBufferSize=32768&amp;responseBufferSize=32768&amp;httpMethodRestrict=POST" />

      <to uri="bean:uploadFromArchiveFileProcessor?method=process" pattern="InOut" />

      </route>

      <bean id="jetty" class="org.apache.camel.component.jetty9.JettyHttpComponent9">
      <property name="endpointClass" value="org.apache.camel.component.jetty9.JettyHttpEndpoint9" />
      <property name="sslContextParameters" ref="sslContextParameters" />
      <property name="useContinuation" value="true" />
      <property name="requestBufferSize" value="32768" />
      <property name="responseBufferSize" value="32768" />

      <property name="threadPool">
      <bean class="org.eclipse.jetty.util.thread.QueuedThreadPool">
      <constructor-arg index="0" value="1000" />
      </bean>
      </property>

      <property name="jettyHttpBinding">
      <bean class="org.apache.camel.component.jetty.DefaultJettyHttpBinding">
      <property name="transferException" value="false" />
      </bean>
      </property>
      </bean>

      When I send file to this endpoint I have out of memory with this stacktrace:

      java.lang.OutOfMemoryError: Java heap space
      at java.lang.StringCoding.decode(StringCoding.java:215)
      at java.lang.String.<init>(String.java:463)
      at java.lang.String.<init>(String.java:515)
      at org.eclipse.jetty.servlets.MultiPartFilter$Wrapper.getParameterBytesAsString(MultiPartFilter.java:390)
      at org.eclipse.jetty.servlets.MultiPartFilter$Wrapper.getParameterValues(MultiPartFilter.java:337)
      at org.apache.camel.http.common.DefaultHttpBinding.populateRequestParameters(DefaultHttpBinding.java:219)
      at org.apache.camel.http.common.DefaultHttpBinding.readHeaders(DefaultHttpBinding.java:174)
      at org.apache.camel.http.common.DefaultHttpBinding.readRequest(DefaultHttpBinding.java:110)
      at org.apache.camel.http.common.HttpMessage.<init>(HttpMessage.java:52)
      at org.apache.camel.component.jetty.CamelContinuationServlet.doService(CamelContinuationServlet.java:161)
      at org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:74)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      at org.eclipse.jetty.servlets.MultiPartFilter.doFilter(MultiPartFilter.java:200)
      at org.apache.camel.component.jetty.CamelFilterWrapper.doFilter(CamelFilterWrapper.java:43)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:499)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      at java.lang.Thread.run(Thread.java:745)

      Attachments

        Activity

          People

            igarashitm Tomohisa Igarashi
            vvsh Uladzimir Shelhunou
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: