activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ee7arh <>
Subject Build up of Threads using Multicast Discovery Agent - eventually out of memory
Date Thu, 11 Jun 2009 14:52:29 GMT


I have a problem that my application runs out of memory after a few days. I
ran jconsole against it and notice that the threads are building up and up.
In the "Threads" section of jconsole, I see that the vast majority of
Threads are "Multicast Discovery Agent Notifier" so I think the problem is
related to this.

My application uses ActiveMQ message broker and Camel router internally and
sends messages to other external message brokers which it discovers using
Multicast discovery.

Here is an extract of the Spring configuration file (the application is
launched from Spring)

<!-- ActiveMQ broker listening on port 61618 -->
    <broker:broker useJmx="false" persistent="true" brokerName="localhost">
directory="../../activemq-data-eventgen" maxFileLength="32mb"/>

            <broker:transportConnector name="tcp"
    <!-- configure the Camel JMS consumer to use the ActiveMQ broker
declared above -->
    <bean id="jmsExternal"
        <property name="connectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <!-- use multicast to detect other broker - group=groupName
of network to look for -->
                <property name="brokerURL"

To send a message to the external queue "jmsExternal" I call the method in
POJO object:


Only thing I noticed in the logs is that every time my application wants to
send a message, it seems to rediscover the brokers each time and prints them
out in the logs however I have no idea on the internal working of multicast
discovery so that could be completely normal.

I am using activeMQ 5.2.0 but the brokers which are being discovered are
using the FUSE 5.3 version.

If select one of the thousands of Multicast threads displayed in Jconsole,
they all have the same stack trace as this:

Name: Multicast Discovery Agent Notifier
State: WAITING on
Total blocked: 0  Total waited: 1

Stack trace:
sun.misc.Unsafe.park(Native Method)

Help appreciated.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message