Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 7388 invoked from network); 17 Sep 2008 14:52:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 14:52:02 -0000 Received: (qmail 92268 invoked by uid 500); 17 Sep 2008 14:51:58 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 92252 invoked by uid 500); 17 Sep 2008 14:51:58 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 92238 invoked by uid 99); 17 Sep 2008 14:51:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 07:51:58 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 14:50:56 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KfyNM-0007y8-GI for users@activemq.apache.org; Wed, 17 Sep 2008 07:51:28 -0700 Message-ID: <19533887.post@talk.nabble.com> Date: Wed, 17 Sep 2008 07:51:28 -0700 (PDT) From: Badri To: users@activemq.apache.org Subject: Re: Out Of Memory Error while running TopicPublisher/TopicListener In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: badrinarayanan.doraiswamy@fxall.com References: <19515522.post@talk.nabble.com> <7b3355cb0809161321v78dee173x97279b358dd2c818@mail.gmail.com> <19520251.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks Rob for info. Does the tag advisoryForSlowConsumers be used in policyEntry? I could see 2 tags for advisory - advisorySupport & sendAdvisoryIfNoConsumers in the activemq-core-5.2.xsd. I just referred to activemq-core-5.2-SNAPSHOT.xsd & did not find tag advisoryForSlowConsumers. Not sure if I am looking at wrong place. Where can I find the xsd & source files? All mirror sites were giving me 404 when I wanted to download the 5.2 source. http://www.apache.org/dist/activemq/apache-activemq/ does not have 5.2 branch. I am guessing that the 5.2 has not yet been promoted. rajdavies wrote: > > Your client is running foul of the topic prefetch - either use more > memory (as you've suggested) - or use a smaller prefetch - see > http://activemq.apache.org/what-is-the-prefetch-limit-for.html. > > The slow consumer advisory will be generated from the broker when this > limit is reached - but only if enabled (its off by default) > > To enable it - use a DestinationPolicy - see > http://activemq.apache.org/per-destination-policies.html > The documentation here needs updating - but the property you need to > set is advisoryForSlowConsumers > > cheers, > > Rob > > Rob Davies > http://rajdavies.blogspot.com/ > > > On 16 Sep 2008, at 22:01, Badri wrote: > >> >> I am running broker, publisher, consumer all in Windows. >> I have not tried this in Linux. >> The broker & publisher are working fine. It's the consumer which is >> crashing. Removing Thread.sleep(1000), consumer works fine. It did >> not crash >> for a good amount of time before I manually stopped the TopicListener. >> >> Windows XP Professional with SP2, 2GB RAM. >> Java: 1.6.0_06 >> >> Of course this was my first test to simulate slow consumer & also >> see if the >> advisory topic appears in the web console. So I used my desktop & >> stumbled >> across this memory error. I just felt maybe crash could be due to >> using >> Windows. I intend to do the same test in Linux. >> >> >> bsnyder wrote: >>> >>> On Tue, Sep 16, 2008 at 10:33 AM, Badri >>> wrote: >>>> >>>> Hi >>>> >>>> I am trying to simulate slow consumer using the classes >>>> (TopicPublisher/TopicListener) provided in examples. >>>> >>>> I wanted to see if Web Console prints the Advisory topic for Slow >>>> Consumer. >>>> But I am facing Out Of Memory Error & the consumer stops abruptly. >>>> >>>> Following are changes I did: >>>> >>>> activemq.xml: >>>> >>>> >>>> >>> uri="tcp://localhost:61616?maxInactivityDuration=-1"/> >>>> >>>> >>>> >>>> TopicListener: I added a sleep of 1000 to induce some slowness. >>>> if (++count % 1000 == 0) { >>>> System.out.println("Received " + count + " >>>> messages."); >>>> try >>>> { >>>> Thread.sleep(1000); >>>> } >>>> catch (Exception e) >>>> { >>>> >>>> } >>>> } >>>> >>>> I give java -Xmx256m -Xms128m when using TopicListener. >>>> After maybe 5 minutes it crashes. After receiving anywhere between >>>> 15-20 >>>> batches of 1000 messages, it crashes. >>>> >>>> Exception: >>>> Received 9000 messages. >>>> Received 10000 messages. >>>> javax.jms.JMSException: Unexpected error occured >>>> at >>>> org >>>> .apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSuppo >>>> rt.java:62) >>>> at >>>> org >>>> .apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnect >>>> ion.java:1255) >>>> at >>>> org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1659) >>>> at >>>> org >>>> .apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu >>>> cer.java:227) >>>> at >>>> org >>>> .apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessa >>>> geProducerSupport.java:241) >>>> at TopicListener.onMessage(TopicListener.java:96) >>>> at >>>> org >>>> .apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageC >>>> onsumer.java:983) >>>> at >>>> org >>>> .apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionE >>>> xecutor.java:122) >>>> at >>>> org >>>> .apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionEx >>>> ecutor.java:192) >>>> at >>>> org >>>> .apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner. >>>> java:122) >>>> at >>>> org.apache.activemq.thread.PooledTaskRunner >>>> $1.run(PooledTaskRunner.ja >>>> va:43) >>>> at >>>> java.util.concurrent.ThreadPoolExecutor >>>> $Worker.runTask(ThreadPoolExec >>>> utor.java:885) >>>> at >>>> java.util.concurrent.ThreadPoolExecutor >>>> $Worker.run(ThreadPoolExecutor >>>> .java:907) >>>> at java.lang.Thread.run(Thread.java:619) >>>> Caused by: java.io.IOException: Unexpected error occured >>>> at >>>> org >>>> .apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java: >>>> 191) >>>> ... 1 more >>>> Caused by: java.lang.OutOfMemoryError: Java heap space >>>> at >>>> org >>>> .apache.activemq.openwire.v3.BaseDataStreamMarshaller.tightUnmarsh >>>> alByteSequence(BaseDataStreamMarshaller.java:440) >>>> at >>>> org >>>> .apache.activemq.openwire.v3.MessageMarshaller.tightUnmarshal(Mess >>>> ageMarshaller.java:68) >>>> at >>>> org >>>> .apache.activemq.openwire.v3.ActiveMQMessageMarshaller.tightUnmars >>>> hal(ActiveMQMessageMarshaller.java:67) >>>> at >>>> org >>>> .apache.activemq.openwire.v3.ActiveMQBytesMessageMarshaller.tightU >>>> nmarshal(ActiveMQBytesMessageMarshaller.java:67) >>>> at >>>> org >>>> .apache.activemq.openwire.OpenWireFormat.tightUnmarshalNestedObjec >>>> t(OpenWireFormat.java:453) >>>> at >>>> org >>>> .apache.activemq.openwire.v3.BaseDataStreamMarshaller.tightUnmarsa >>>> lNestedObject(BaseDataStreamMarshaller.java:126) >>>> at >>>> org >>>> .apache.activemq.openwire.v3.MessageDispatchMarshaller.tightUnmars >>>> hal(MessageDispatchMarshaller.java:72) >>>> at >>>> org >>>> .apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireForma >>>> t.java:362) >>>> at >>>> org >>>> .apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat. >>>> java:276) >>>> at >>>> org >>>> .apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTranspo >>>> rt.java:209) >>>> at >>>> org >>>> .apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.jav >>>> a:201) >>>> at >>>> org >>>> .apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java: >>>> 184) >>>> ... 1 more >>>> Received 1000 messages. >>>> Received 2000 messages. >>>> >>>> TopicPublisher: >>>> private long batch(int msgCount) throws Exception { >>>> // Commented out call to waitForCompletion >>>> // waitForCompletion(); >>>> } >>>> >>>> QN 1) I just want to know if I am configuring something wrong. Or >>>> should >>>> I >>>> increase -Xmx512m when running TopicListener to get rid of OOME? >>> >>> You shouldn't need to raise the memory at all as there should be >>> nothing causing memory to grow. I just added the sleep above to the >>> TopicListener using ActiveMQ 5.2.0 and I've produced and consumed >>> over >>> 300,000 messages in a matter of moments without any issue whatsoever. >>> I'm on MacOS X using Java 1.5.0_13. What OS and Java version are you >>> using? >>> >>>> QN 2) Will the advisory topic: >>>> ActiveMQ.Advisory.SlowConsumer.Topic.topictest.messages appear >>>> only if >>>> the >>>> consumer starts discarding messages? What is the basis for this >>>> topic to >>>> appear in Web console? >>> >>> I'm not able to see the *SlowConsumer* topic appear at all. I don't >>> know if that's because I'm using a dual core Intel processor or what. >>> What type of processor does your machine have? >>> >>> Bruce >>> -- >>> perl -e 'print >>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E>> );' >>> >>> Apache ActiveMQ - http://activemq.org/ >>> Apache Camel - http://activemq.org/camel/ >>> Apache ServiceMix - http://servicemix.org/ >>> >>> Blog: http://bruceblog.org/ >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/Out-Of-Memory-Error-while-running-TopicPublisher-TopicListener-in-ActiveMQ-5.2-tp19515522p19520251.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> > > > -- View this message in context: http://www.nabble.com/Out-Of-Memory-Error-while-running-TopicPublisher-TopicListener-in-ActiveMQ-5.2-tp19515522p19533887.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.