Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BE1E2106F4 for ; Mon, 17 Feb 2014 08:24:09 +0000 (UTC) Received: (qmail 4593 invoked by uid 500); 17 Feb 2014 08:24:08 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 4538 invoked by uid 500); 17 Feb 2014 08:24:07 -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 4525 invoked by uid 99); 17 Feb 2014 08:24:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Feb 2014 08:24:06 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLYTO_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [106.10.151.51] (HELO nm22-vm4.bullet.mail.sg3.yahoo.com) (106.10.151.51) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Feb 2014 08:23:58 +0000 Received: from [106.10.166.127] by nm22.bullet.mail.sg3.yahoo.com with NNFMP; 17 Feb 2014 08:23:35 -0000 Received: from [106.10.151.251] by tm16.bullet.mail.sg3.yahoo.com with NNFMP; 17 Feb 2014 08:23:35 -0000 Received: from [127.0.0.1] by omp1022.mail.sg3.yahoo.com with NNFMP; 17 Feb 2014 08:23:35 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 432562.48366.bm@omp1022.mail.sg3.yahoo.com Received: (qmail 48142 invoked by uid 60001); 17 Feb 2014 08:23:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.in; s=s1024; t=1392625415; bh=3JJA7cPxJfAr2eKnwodgEy4xf9P/a/kOrKsKwepFWd4=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Lt6X81xfbQc0CBYAHdNbJLMHLYDA9NyISOEP360/TyHCvFeyu0SnHwFGtaomAfEhtFRnu0XnC8E5w6VBtSYwJNWu/5sbTtfnkA8tTf1NgVjrEmk8p0jcoffY7rQNPBvgPWXFnh5ayCy06jv0xh9h7AhJMZO5F0zR2kB6vzVZ8EQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.in; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=D50TaRtp/1aq4CnZHtZAfIv+ofZ4aW8PW3KEThn3Z2hz42XFWk/a9G8PpGaUXnDRnrgjHU5Ly6irbrquc9jTpUuAbL0Wywgb+lifBcwHZuPJbKrM5Ylsk2Ga7rAPvnLImp44wq+MlWWh/EIGq7hSSBhyAmO6y2AsBP/wCnswbQ8=; X-YMail-OSG: AOKs3oAVM1nFsK5AlzVBTQYKqmH9fOz56R97Ed1UwqqVXXM NqeYT1jlXbVYN6M8wFLeP3v1aT6N2WV.5FRAHh_n4Aoqw6TMtNNqNOaC4AP5 hDoBDb9EOHUw5e.1AczDMo4H_2KppvxWtg1HKUyzxYa83FEaNpsYFJnSnvxq 8Fh.hXWrKGwXhNAoYie58dea9tNW3ZNK0xlG1kDP.m21QNxiBynDPY.q48Mu 4CrdepJ4tAr9Nxk.X7Qda9O0NcOIGVUbUrpxoTwD1_n02ibb96r8klIykoIq A1vg.yVEyzPelzVRsj1iYiD0gmVMG4qUxocsEQMloWftZ8MfnS_OQ4._dn3U EYUoinGREtXC5AXXqYUrWrmjdxwIa31yc9GgMOuUlMjJv8LNM5wXh.K6d87P 4b_.oxGtp1PdPpwmzXNRCWTVIJxuXeupqfAIlh_1wvtZ8IleO7rS4q_SRJnz rw51xQeDnL8vCk9vJdsc8ONF2ranNRiOcsbi1jXBEs40.dxYCApD06hPlBf4 SFDSQAW2Jh0uWV0l5M8ByWsU.RZF5y76KOJIK7lOAXe3fNFQRCu6unsEmrhN NwBio_3_do9gWRGtfiL9OHpNzrXwal5ub0TQzCSx8s_EZT84Uac6av0EYdk3 P0IjFiExQwrPMJ4Yyvkh7kItbg0ozpBcfBiDwEJMdO86hWDWRKBt2hevupMr w._wG48MEnDYIm5E2i8YfNUrhzmKEORAs0g-- Received: from [192.71.175.12] by web190706.mail.sg3.yahoo.com via HTTP; Mon, 17 Feb 2014 16:23:34 SGT X-Rocket-MIMEInfo: 002.001,SGkgQ2xhdXMsCgpJIGhhZCB0aGlzIGltcGxlbWVudGF0aW9uIGJlZm9yZS4gV2l0aCB0aGlzIEkgc2F3IGFuIHVudXN1YWwgYmVoYXZpb3VyLiBBIHRocmVhZCB3YXMgY3JlYXRlZCBmb3IgZXZlcnkgZmlsZSBjb25zdW1lZCBieSB0aGUgdGVtcGxhdGUgYW5kIGV2ZW4gdGhvdWdoIEkgY2FsbGVkIHRlbXBsYXRlLmRvbmVVb1cgdGhlIHRocmVhZCBpcyBub3Qgc3RvcHBlZC4gU28gaWYgSSBjYWxsIGRvbmVVb1coYW5kIG5vdCBzdG9wKSB0aGUgdGhyZWFkIHNob3VsZCBiZSBkZXN0cm95ZWQ_IEFuZCBhbHNvIG8BMAEBAQE- X-Mailer: YahooMailWebService/0.8.177.636 References: <1392202216.87510.YahooMailNeo@web190704.mail.sg3.yahoo.com> <1392208624.13678.YahooMailNeo@web190703.mail.sg3.yahoo.com> <1392210119.96078.YahooMailNeo@web190702.mail.sg3.yahoo.com> <1392371562.3046.YahooMailNeo@web190705.mail.sg3.yahoo.com> <1392620411.38061.YahooMailNeo@web190704.mail.sg3.yahoo.com> <1392623394.97720.YahooMailNeo@web190703.mail.sg3.yahoo.com> Message-ID: <1392625414.3505.YahooMailNeo@web190706.mail.sg3.yahoo.com> Date: Mon, 17 Feb 2014 16:23:34 +0800 (SGT) From: Chirag Dewan Reply-To: Chirag Dewan Subject: Re: OOM issue due to MemoryIdempotentRepository To: "users@camel.apache.org" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1489772017-415116080-1392625414=:3505" X-Virus-Checked: Checked by ClamAV on apache.org ---1489772017-415116080-1392625414=:3505 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Claus,=0A=0AI had this implementation before. With this I saw an unusual= behaviour. A thread was created for every file consumed by the template an= d even though I called template.doneUoW the thread is not stopped. So if I = call doneUoW(and not stop) the thread should be destroyed? And also on done= UoW the inprogressRepository cache is cleared. Which is not getting cleared= at the moment(the reason I believe is causing the . Is there a possibility= that doneUoW is not working as it should?=0A=0AThanks .=0A=0AChirag=A0 =0A= =0A=0A=0A=0A________________________________=0A From: Claus Ibsen =0ATo: "users@camel.apache.org" ; Chi= rag Dewan =0ASent: Monday, 17 February 2014 1:28 = PM=0ASubject: Re: OOM issue due to MemoryIdempotentRepository=0A =0A=0AOn M= on, Feb 17, 2014 at 8:49 AM, Chirag Dewan wrote:= =0A> Hi Claus,=0A>=0A> So I dont need to start/stop the template for every = file?=0A>=0A> Right now I create a consumerTemplate at satrtup and then on = every method call(responsible for consuming file) I start the template,cons= ume the file(template.receive) and stop the template.=0A>=0A> Is this the r= ight approach?=0A>=0A=0ANo, only start|stop the template once on startup an= d shutdown of your app.=0AAnd then call doneUoW for each file you consume.= =0A=0A=0A> Thanks.=0A>=0A> Chirag=0A>=0A>=0A>=0A>=0A> _____________________= ___________=0A>=A0 From: Claus Ibsen =0A> To: "users= @camel.apache.org" =0A> Sent: Monday, 17 February 2= 014 12:33 PM=0A> Subject: Re: OOM issue due to MemoryIdempotentRepository= =0A>=0A>=0A> Hi=0A>=0A> You should likely reuse the consumer template inste= ad. As this FAQ=0A> applies to it too=0A> http://camel.apache.org/why-does-= camel-use-too-many-threads-with-producertemplate.html=0A>=0A> On Mon, Feb 1= 7, 2014 at 8:00 AM, Chirag Dewan wrote:=0A>> Hi A= ll,=0A>>=0A>> Any views on this?=0A>>=0A>> Actually my previous mail is not= understandable. Let me rephrase the issue.=0A>>=0A>> I am using consumer t= emplate to consume single file using fileName property. I have a single ins= tance of consumerTemplate and I call doneUoW and stop after consuming the f= ile.=0A>>=0A>> I am running a test case where 10000 files are consumed by c= onsumerTemplate(one file at a time) . After a while JVM goes OOM and crashe= s. In heap dump,I can see large number of MemoryIdempotentRepository instan= ces. I am not using idempotent=3Dtrue. I figured out that inProgressReposit= ory also uses this cache.=0A>>=0A>> Is there something I am missing here?= =0A>>=0A>> Thanks in advance.=0A>>=0A>> Chirag Dewan=0A>>=0A>>=0A>>=0A>>=0A= >> ________________________________=0A>>=A0 From: Chirag Dewan =0A>> To: "users@camel.apache.org" ; C= hirag Dewan =0A>> Sent: Friday, 14 February 2014 3= :22 PM=0A>> Subject: Re: OOM issue due to MemoryIdempotentRepository=0A>>= =0A>>=0A>> Hi All,=0A>>=0A>> I have been looking around why a large number = of heap is being consumed by MemoryIdempotentRepository. I saw one JIRA as = well regarding inProgressRepository not getting cleared. Can that be the re= ason here?=0A>>=0A>> Also,I am not using consumerTemplate to consume 1000o = files. Does that also use inProgressRepository? And when is it cleared from= the memory?=0A>>=0A>> Any help is much appreciated.=0A>>=0A>> Thanks!=0A>>= =0A>> Chirag Dewan=0A>>=0A>>=0A>>=0A>>=0A>> _______________________________= _=0A>>=0A>> From: Chirag Dewan =0A>> To: "users@ca= mel.apache.org" ; Chirag Dewan =0A>> Sent: Wednesday, 12 February 2014 6:31 PM=0A>> Subject: Re: OOM = issue due to MemoryIdempotentRepository=0A>>=0A>>=0A>> Hi,=0A>>=0A>> And I = am using readLock=3Dchanged. So that can be a reason too?=0A>>=0A>> Chirag = Dewan=0A>>=0A>>=0A>>=0A>>=0A>> ________________________________=0A>>=0A>> F= rom: Chirag Dewan =0A>> To: "users@camel.apache.or= g" =0A>> Sent: Wednesday, 12 February 2014 6:07 PM= =0A>> Subject: Re: OOM issue due to MemoryIdempotentRepository=0A>>=0A>>=0A= >> Hi Claus,=0A>>=0A>> Thanks for the quick reply.=0A>>=0A>> It might well = be. But there is one thing I would like to get some insight into.=0A>>=0A>>= If idempotent=3Dfalse(default) is used,will the LRU Cache still store the = file referrence? Because that is what I can see in my memory dump.=0A>>=0A>= > org.apache.camel.util.LRUCache=0A>>=A0 >org.apache.camel.com.googlecode.= concurrentlinkedhashmap.ConcurrentLinkedHashMap=0A>>=0A>> I maybe doing som= ething wrong here. Is there anything else I need to do to make sure that fi= le is deleted after it has been processed and not stored in the cache?=0A>>= =0A>> Thanks.=0A>>=0A>> Chirag Dewan=0A>>=0A>>=0A>>=0A>>=0A>>=0A>> ________= ________________________=0A>>=0A>> From: Claus Ibsen =0A>> To: "users@camel.apache.org" =0A>> Sent: Wed= nesday, 12 February 2014 5:42 PM=0A>> Subject: Re: OOM issue due to MemoryI= dempotentRepository=0A>>=0A>>=0A>> Hi=0A>>=0A>> Some days ago someone else = posted about a OOME issue when using Storm.=0A>> It smells like a Storm + C= amel issue somewhere.=0A>>=0A>>=0A>>=0A>> On Wed, Feb 12, 2014 at 11:50 AM,= Chirag Dewan wrote:=0A>>> Hi All,=0A>>>=0A>>> I = am using Camel 2.12.1 with JDK 1.7.0_45. I have a FTP consumer route in my = application.=0A>>>=0A>>>=0A>>> Now I intent to delete the file after consum= ing it. So I have delete=3Dtrue in my route. After consuming around 6000 fi= les(out of 10000,as my test case) JVM goes Out of memory.=0A>>>=0A>>>=0A>>>= In my heap dump I can see the following trace as the major memory consumer= s:=0A>>>=0A>>> java.util.ArrayList=0A>>>=A0 >java.lang.Object=0A>>>=0A>>>= =A0 =A0 >org.apache.camel.management.DefaultManagementLifecycleStrategy$Pr= eRegisterService=0A>>>=0A>>>=A0 =A0 =A0 =A0 >org.apache.camel.component.fi= le.FileEndpoint=0A>>>=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 >org.apache.camel.proce= ssor.idempotent.MemoryIdempotentRepository=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 >org.apache.camel.util.LRUCache=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 >org.apache.camel.com.googlecode.concurrentlinkedhashmap.Concu= rrentLinkedHashMap=0A>>>=0A>>>=0A>>> So if I am not using indempotent,shoul= d it still store the files in the memory? Is this memory repository used,ev= en if I am deleting the files and not storing in memory? Is there a way I c= an avoid that?=0A>>>=0A>>> I am testing this scenario under Storm as execut= ion environment and with 2GB max heap space.=0A>>>=0A>>> Thanks in advance= =0A>>>=0A>>> Chirag Dewan=0A>>=0A>>=0A>>=0A>> --=0A>> Claus Ibsen=0A>> ----= -------------=0A>> Red Hat, Inc.=0A>> Email: cibsen@redhat.com=0A>> Twitter= : davsclaus=0A>> Blog: http://davsclaus.com=0A>> Author of Camel in Action:= http://www.manning.com/ibsen=0A>> Make your Camel applications look hawt, = try: http://hawt.io=0A=0A>=0A>=0A>=0A>=0A> --=0A> Claus Ibsen=0A> ---------= --------=0A> Red Hat, Inc.=0A> Email: cibsen@redhat.com=0A> Twitter: davscl= aus=0A> Blog: http://davsclaus.com=0A> Author of Camel in Action: http://ww= w.manning.com/ibsen=0A> Make your Camel applications look hawt, try: http:/= /hawt.io=0A=0A=0A=0A-- =0AClaus Ibsen=0A-----------------=0ARed Hat, Inc.= =0AEmail: cibsen@redhat.com=0ATwitter: davsclaus=0ABlog: http://davsclaus.c= om=0AAuthor of Camel in Action: http://www.manning.com/ibsen=0AMake your Ca= mel applications look hawt, try: http://hawt.io ---1489772017-415116080-1392625414=:3505--