ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » OutofMemoryError in Tomcat for JMS/MQ Browse

Post new topic  Reply to topic
 OutofMemoryError in Tomcat for JMS/MQ Browse « View previous topic :: View next topic » 
Author Message
balareddy
PostPosted: Mon Aug 28, 2006 3:12 am    Post subject: OutofMemoryError in Tomcat for JMS/MQ Browse Reply with quote

Acolyte

Joined: 06 Feb 2006
Posts: 54

Hi,

I am getting message count with QueueBroser from MQ with JMS. I am using QCF to get Connection.

I am getting counts from different queus and displaying for monitoring purpose by refreshing browser page every 10 seconds.

After starting Tomcat, after some time i am getting OutOfMemory error in tomcat log.

===============
java.lang.OutOfMemoryError
at com.ibm.mq.MQQueue.getMsg2Int(MQQueue.java(Compiled Code))
at com.ibm.mq.MQQueue.getMsg2(MQQueue.java(Compiled Code))
at com.ibm.mq.jms.MQQueueEnumeration.retrieveMessage(MQQueueEnumeration.java(Compiled Code))
at com.ibm.mq.jms.MQQueueEnumeration.hasMoreElements(MQQueueEnumeration.java(Compiled Code))
at de.gefm.cap2.queue.MQConfig.getMsgCountInQueue(MQConfig.java(Compiled Code))
===========
I am creating browsers instances in servlet init() methood and reusing those instances every 10 seconds. i am not closing browsers...


anybody let me know the solution...............
_________________
bala
Back to top
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Mon Aug 28, 2006 2:39 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Quote:
I am creating browsers instances in servlet init() methood and reusing those instances every 10 seconds. i am not closing browsers...


How many of those instances are active when you get the OOM message?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
balareddy
PostPosted: Mon Aug 28, 2006 11:38 pm    Post subject: Reply with quote

Acolyte

Joined: 06 Feb 2006
Posts: 54

fjb_saper wrote:
Quote:
I am creating browsers instances in servlet init() methood and reusing those instances every 10 seconds. i am not closing browsers...


How many of those instances are active when you get the OOM message?


I am creating 20 browsers for 20 Queues. All are active everytime.
I am getting count with browser enumeration option in loop for all queues one by one.
_________________
bala
Back to top
View user's profile Send private message AIM Address
jefflowrey
PostPosted: Tue Aug 29, 2006 1:29 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Do you monitor database tables by doing a SELECT * and then counting the returned rows, too?

There are many many better ways to monitor queue depth than what you are doing.

There is even a manual for WebSphere MQ that is devoted to the subject of Monitoring WebSphere MQ.

JMS may not be your best approach here, either.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
balareddy
PostPosted: Tue Aug 29, 2006 4:03 am    Post subject: Reply with quote

Acolyte

Joined: 06 Feb 2006
Posts: 54

jefflowrey wrote:
Do you monitor database tables by doing a SELECT * and then counting the returned rows, too?

There are many many better ways to monitor queue depth than what you are doing.

There is even a manual for WebSphere MQ that is devoted to the subject of Monitoring WebSphere MQ.

JMS may not be your best approach here, either.

I have to display Queue depths in Tomcat browser page and this page refreshes every 10 seconds.
Could you please tell me some other ways to implement this to avoid memory problem????
_________________
bala
Back to top
View user's profile Send private message AIM Address
jefflowrey
PostPosted: Tue Aug 29, 2006 4:05 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I would use PCF messages to Inquire Queue stats and get the current depth, myself.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
colincrist
PostPosted: Tue Aug 29, 2006 6:40 am    Post subject: Reply with quote

Novice

Joined: 24 Feb 2004
Posts: 22

JMS was never designed to cover management and monitoring. Queue browsing to get depths will place some considerable additional load on the MQ managers and you won't be popular with the other users...

Look at the getDepth() method in here for an example of using PCF.

http://hermesjms.cvs.sourceforge.net/hermesjms/Hermes4/src/java/hermes/ext/mq/MQSeriesAdmin.java?revision=1.17&view=markup

As to your OOME, you're probably not cleaning up the JMS queuebrowser/ session or somewhere in your web session you're holding references to the messages via some collection or other object....

Colin.
http://hermesjms.com
Back to top
View user's profile Send private message
saketr
PostPosted: Tue Aug 29, 2006 1:50 pm    Post subject: Reply with quote

Apprentice

Joined: 08 Feb 2006
Posts: 41

Some thoughts:

a) Specify heap options for the tomcat JVM, basic ones are -Xms and -Xmx
b) Monitor the heap usage using -verbose:gc
c) Advanced diagnostics - heap dumps and heap diffs

If using IBM JVMs, see IBM Diagnostics Guide for more info:
http://www-128.ibm.com/developerworks/java/jdk/diagnosis/

If using Sun JVMs, see the following page and associated links for more info:
http://java.sun.com/developer/technicalArticles/Programming/GCPortal/index.html

Warm regards,
Saket
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » OutofMemoryError in Tomcat for JMS/MQ Browse
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.