1 Reply Latest reply on Jun 18, 2014 10:28 AM by Tom Cunningham

    Issue with jms queues messages on JBoss, causing jvm out of memory errors

    Nagarjuna Appasamudram Newbie


      Hi,

      i am using JBossMessaging as JMS service provider on JBOSS SOAP5.3.1.with jdbc2 persistance manager and Oracle database.

      some times, if some of JMS queues messages count is more like 40k+, our JBoss server facing JVM out of memory error and stalls the application server.

       

      so we are clearing all JBossmessaging tables on Oracle db used for persistance and restarting JBoss server which is solving the problem, but we are loosing the messages on other JMS queues also.

       

      1. We tried to delete only that particular problematic JMS queue messages on database and then restarting JBoss with below commands. But still out of memory problem persists.
      • we using below query to know which jms queue has more messages from Oracle db:::

      SELECT r.channel_id,  po.queue_name,  po.node_id,  po.cond,  COUNT(*) COUNT FROM jbm_msg_ref r,  jbm_postoffice po

      WHERE r.channel_id = po.channel_id GROUP BY r.channel_id ,   po.queue_name,   po.cond,  po.node_id ORDER BY COUNT DESC;

      • From the above table, we will get the 'channel_id' (for example 364) column value for JMS queue which has highest mesage count.

                By using that channel number in below queries to delete jms messages and it references in corresponding tables.

               select * from jbm_msg where message_id in (select message_id from jbm_msg_ref where channel_id like '364');

               delete from jbm_msg where message_id in (select message_id from jbm_msg_ref where channel_id like '364');

               delete from jbm_msg_ref where channel_id like '364';

      -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Please suggest is there anyother way, we can clear only those jms queues messages (by deleting msgs from database) and no need to clear all the remaining JBossMessaging related tables on database sothat we don't loose other JMS queues persisted messages and then restarting the server.