Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 11B8D200BA5 for ; Wed, 19 Oct 2016 14:39:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 104F5160AEA; Wed, 19 Oct 2016 12:39:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2F10A160ADE for ; Wed, 19 Oct 2016 14:39:51 +0200 (CEST) Received: (qmail 13340 invoked by uid 500); 19 Oct 2016 12:39:50 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 13328 invoked by uid 99); 19 Oct 2016 12:39:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2016 12:39:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2872B180149 for ; Wed, 19 Oct 2016 12:39:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id uSRUr5f_439q for ; Wed, 19 Oct 2016 12:39:47 +0000 (UTC) Received: from mail-ua0-f169.google.com (mail-ua0-f169.google.com [209.85.217.169]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id BC1D15FDF9 for ; Wed, 19 Oct 2016 12:39:46 +0000 (UTC) Received: by mail-ua0-f169.google.com with SMTP id r64so8514444uar.2 for ; Wed, 19 Oct 2016 05:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=GWlkDpWIZNR+Upixy5AHUwBN4sqvorN6NNpdlOcGbTM=; b=yZskGg553oteIQpeJM27YZsiKDtnkNgSFfZ1FDV1ydF8J+e6VBgIkyPaPhPBMmT1jb 9xI1osa/WdwSOaXc3FSb4+6H3s13sKV2KqvR+ybLDkwTrU1NtOrxZNTxvxVerzU0dpYY Wy7ORsOcvpgrSuor1gbXljtJciMn/5iRKfGknskyIMPBRLskRCpbOYf8Aq7m77XFcOsm saP4LpU4Fy6Vujx7fvQKWg7bU+L5u7t/SxrF2eaHplnsHE5u+tgehpDrFbmXyQhE2DVt lq9pXoYaN1jYLdqtW1N7Ue/C5mlPwQ3IPXNONxcop+rHgHxb9f/8KNxQihU+HB/faqSy I4vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=GWlkDpWIZNR+Upixy5AHUwBN4sqvorN6NNpdlOcGbTM=; b=ASIc/Id4XaPB0LyZGHKNvwkXyj+ZLV4gUPJ1BC+Bqrv05d3yrRm1HVZoxIOifsrL9t PJwuBzFQgiDTA/UTEeWhJGYk4P2+RzDjdatOVsCPgxYIRlCeCCPsVAqDMJ1zrS4NEm2e jOEFEupSguqNdBsJbt+Kl7+oez1fQJK+Cv1ocylmKGrSRxs4ZIyQWw5dXzxjy36VATbL Gq2tG1mJJFTpEyihiFVIoCzpdeTuNCMJUYHKjHSKNZfJ4sjirQoSxaK61D21F2/dJW1M /blSEb6SgCGOHQEFVdc0KiO3jPgCKoBFHQ7zFgDWdiI6zmVIVHtemhP3NR+j2FovNwBV Zr8w== X-Gm-Message-State: AA6/9RlflHVfu70/2/wHHsWUUdjFFGeDrPrntN4imHGWMq6VJ6snIJHcW4HCwdcwU9gp0I0N4tnMvpxl0rBX6g== X-Received: by 10.159.51.10 with SMTP id o10mr1742552uab.160.1476880779786; Wed, 19 Oct 2016 05:39:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.13.1 with HTTP; Wed, 19 Oct 2016 05:39:39 -0700 (PDT) In-Reply-To: <308255934.778948.1476880108991@mail.yahoo.com> References: <308255934.778948.1476880108991@mail.yahoo.com> From: Vova Shelgunov Date: Wed, 19 Oct 2016 15:39:39 +0300 Message-ID: Subject: Re: OutOfMemoryError: Java heap space when sending large file to jetty endpoint To: users@camel.apache.org, Andrea Cosentino Content-Type: multipart/alternative; boundary=f403045de53c414813053f371af9 archived-at: Wed, 19 Oct 2016 12:39:52 -0000 --f403045de53c414813053f371af9 Content-Type: text/plain; charset=UTF-8 Hi Andrea, Yes, I run application using jar file. Java has 1G heap. Actually I assumed that camel will not read file in single string, but will use InputStream to read the data. 2016-10-19 15:28 GMT+03:00 Andrea Cosentino : > Is the camel-context deployed as a simple JAR? What are you using inside > the Debian container? How much memory has your container? > Did you set JVM_OPTS witch specific values for max Heap size and min Heap > size? > > -- > Andrea Cosentino > ---------------------------------- > Apache Camel PMC Member > Apache Karaf Committer > Apache Servicemix Committer > Email: ancosen1985@yahoo.com > Twitter: @oscerd2 > Github: oscerd > > > > On Wednesday, October 19, 2016 2:00 PM, Vova Shelgunov > wrote: > Hi, > > I catched this OutOfMemoryError when I sent a 250 MB file to jetty > endpoint: > > java.lang.OutOfMemoryError: Java heap space > at java.lang.StringCoding.decode(StringCoding.java:215) > at java.lang.String.(String.java:463) > at java.lang.String.(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.(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) > > My configuration: > > > /> > > pattern="InOut" /> > > > > class="org.apache.camel.component.jetty9.JettyHttpComponent9"> > value="org.apache.camel.component.jetty9.JettyHttpEndpoint9" /> > > > > > > > > > > > > > > > > > > > My camel application is running in docker container with limited amount of > memory, and I did not expect, that a file will be read a string instead of > reading from InputStream. > > Is there any way to consume large files with small amount of memory? > > > Regards, > > Uladzimir > --f403045de53c414813053f371af9--