You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by john <jo...@ateb.com> on 2012/02/14 16:13:34 UTC

ACtiveMQConnection leak

I'm running the fuse 4.4.1-fuse-01-13 ESB release which includes camel 2.8
and activemq 5.5.1.

I have a simple camel route whose job is to ensure that a message queue has
X number of records from a db queued up for a consumer. When the timer on
the route fires, a POJO is called. 

The bean uses the camel producer template to send a message to
activemq:queue:ActiveMQ.Statistics.Destination.MYQUEUE to determine how many
messages are currently on the queue. I have the statistics plugin enabled.

The issue I have is that when this route is enabled, I see a slow climb in
PS Old Gen memory. A heap dump shows a ton of ActiveMQConnection and
TransportConnectState objects.

This didn't occur in the much older fuse release we were using. It used
camel 2.2 and activemq 5.4.0.

I do have activemq pooling enabled in the spring configuration. I can
include that information if needed.

I appreciate any help!

-john

--
View this message in context: http://activemq.2283324.n4.nabble.com/ACtiveMQConnection-leak-tp4387316p4387316.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ACtiveMQConnection leak

Posted by Matt Pavlovich <ma...@gmail.com>.
7,289 is definitely a leak.  I was just pointing out the config had 500, 
in case you had something like 489 instances ;-)

Definitely troubleshoot the client side first, much easier to debug.  
You might try a single message test to see if you are getting a leak 
with every message, or if its just happening with exceptions/errors/etc.

Hope this helps,
Matt Pavlovich

On 2/14/12 10:32 AM, john wrote:
> I'll try bumping the max connections down, but I'm not sure I understand how
> it would cause the leak. This route has been running on my dev box since
> last Thursday and as of this morning I have 7,289 instances of the
> ActiveMQConnection and TransportConnectionState.
>
> I guess I could remove the XA configuration for a test if you suspect they
> are causing a problem.
>
> Thanks for your advice!
>
> -john
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQConnection-leak-tp4387316p4387574.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ACtiveMQConnection leak

Posted by john <jo...@ateb.com>.
I'll try bumping the max connections down, but I'm not sure I understand how
it would cause the leak. This route has been running on my dev box since
last Thursday and as of this morning I have 7,289 instances of the
ActiveMQConnection and TransportConnectionState.

I guess I could remove the XA configuration for a test if you suspect they
are causing a problem.

Thanks for your advice!

-john

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQConnection-leak-tp4387316p4387574.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ACtiveMQConnection leak

Posted by Matt Pavlovich <ma...@gmail.com>.
I'm wondering if its a XA problem, or look into adjusting your pool 
config.  It currently allows a max of 500 connections.  For consuming, 
4-5 max connections per CPU core is usually a good ratio.

On 2/14/12 10:12 AM, john wrote:
> I think I'm only using spring for transactions. Here's the configuration I
> have:
>
>      <bean name="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>          <property name="transacted" value="true" />
>          <property name="transactionManager" ref="jmsTxManager" />
>          <property name="connectionFactory" ref="pooledConnectionFactory" />
>      </bean>
>
>
>      <bean id="PROPAGATION_REQUIRED"
> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>          <property name="transactionManager" ref="jmsTxManager"/>
>          <property name="propagationBehaviorName"
> value="PROPAGATION_REQUIRED"/>
>      </bean>
>
>
>      <bean id="PROPAGATION_REQUIRES_NEW"
> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>          <property name="transactionManager" ref="jmsTxManager"/>
>          <property name="propagationBehaviorName"
> value="PROPAGATION_REQUIRES_NEW"/>
>      </bean>
>
>      <bean name="jmsTxManager"
> class="org.springframework.jms.connection.JmsTransactionManager">
>          <property name="connectionFactory" ref="pooledConnectionFactory" />
>      </bean>
>
>      <bean id="pooledConnectionFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory">
>          <property name="maxConnections" value="8" />
>          <property name="maximumActive" value="500" />
>          <property name="connectionFactory" ref="activeMqConnectionFactory"
> />
>      </bean>
>
>      <bean id="activeMqConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>          <property name="brokerURL" value="${amq.brokerURL}" />
>      </bean>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQConnection-leak-tp4387316p4387524.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ACtiveMQConnection leak

Posted by john <jo...@ateb.com>.
I think I'm only using spring for transactions. Here's the configuration I
have:

    <bean name="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="transacted" value="true" />
        <property name="transactionManager" ref="jmsTxManager" />
        <property name="connectionFactory" ref="pooledConnectionFactory" />
    </bean>
    
    
    <bean id="PROPAGATION_REQUIRED"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager" ref="jmsTxManager"/>
        <property name="propagationBehaviorName"
value="PROPAGATION_REQUIRED"/>
    </bean>
    
    
    <bean id="PROPAGATION_REQUIRES_NEW"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager" ref="jmsTxManager"/>
        <property name="propagationBehaviorName"
value="PROPAGATION_REQUIRES_NEW"/>
    </bean>
    
    <bean name="jmsTxManager"
class="org.springframework.jms.connection.JmsTransactionManager">
        <property name="connectionFactory" ref="pooledConnectionFactory" />
    </bean>
    
    <bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
        <property name="maxConnections" value="8" />
        <property name="maximumActive" value="500" />
        <property name="connectionFactory" ref="activeMqConnectionFactory"
/>
    </bean>
    
    <bean id="activeMqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="${amq.brokerURL}" />
    </bean>


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQConnection-leak-tp4387316p4387524.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ACtiveMQConnection leak

Posted by Matt Pavlovich <ma...@gmail.com>.
Are you using the Spring Caching Connection factory?  If so, please 
disable that.  There are a number of reported bugs.  Try the non-caching 
version, or use the ActiveMQConnectionFactory directly.

On 2/14/12 9:13 AM, john wrote:
> I'm running the fuse 4.4.1-fuse-01-13 ESB release which includes camel 2.8
> and activemq 5.5.1.
>
> I have a simple camel route whose job is to ensure that a message queue has
> X number of records from a db queued up for a consumer. When the timer on
> the route fires, a POJO is called.
>
> The bean uses the camel producer template to send a message to
> activemq:queue:ActiveMQ.Statistics.Destination.MYQUEUE to determine how many
> messages are currently on the queue. I have the statistics plugin enabled.
>
> The issue I have is that when this route is enabled, I see a slow climb in
> PS Old Gen memory. A heap dump shows a ton of ActiveMQConnection and
> TransportConnectState objects.
>
> This didn't occur in the much older fuse release we were using. It used
> camel 2.2 and activemq 5.4.0.
>
> I do have activemq pooling enabled in the spring configuration. I can
> include that information if needed.
>
> I appreciate any help!
>
> -john
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ACtiveMQConnection-leak-tp4387316p4387316.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.