Announcement Announcement Module
Collapse
No announcement yet.
Regarding memory leak due to MQ Configuration. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regarding memory leak due to MQ Configuration.

    Hi All,

    I am experiencing memory leak (memory consumed by tomcat process is growing day by day) in my application.

    I think MQ is causing this, but I am not sure.

    My other problem is Tomcat server is not getting stopped (I have to kill the process manually) after I start the server, (I dont know the actual reason for this). (Due to this, Jenkins is not automatically deploying it.)

    Following is my MQ configuration.

    I will be thankful, if anyone can tell me whether I am missing something in my configuration..

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:p="http://www.springframework.org/schema/p" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:tx="http://www.springframework.org/schema/tx" 
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
    				http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    				http://www.springframework.org/schema/context
    				http://www.springframework.org/schema/context/spring-context-3.2.xsd">
    
    	<bean id="xaFactory" class="org.apache.activemq.ActiveMQXAConnectionFactory"
    		p:brokerURL="tcp\://localhost\:61616" 
    		p:redeliveryPolicy-ref="redeliverPolicy" />
    
    	<bean id="redeliverPolicy" class="org.apache.activemq.RedeliveryPolicy"
    		p:maximumRedeliveries="5"
    		p:initialRedeliveryDelay="300000" 
    	 	p:redeliveryDelay="300000"  
    		p:useExponentialBackOff="true" 
    		p:backOffMultiplier="0" />
    
    	<bean id="amqConnectionFactory" class="com.atomikos.jms.AtomikosConnectionFactoryBean"	init-method="init"
    		p:uniqueResourceName="XAEComActiveMQ" 
    		p:xaConnectionFactory-ref="xaFactory"
    		p:maintenanceInterval="10" 
    		p:minPoolSize="5"
    		p:maxPoolSize="10"
    		p:localTransactionMode="false"/>
    
    	<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"
    		p:connectionFactory-ref="amqConnectionFactory" 
    		p:receiveTimeout="2000" 
    		p:sessionTransacted="true" /> 
    
    	<bean id="destinationQueue" class="org.apache.activemq.command.ActiveMQQueue">
    		<constructor-arg value="QueueA" />
    	</bean>
    	
    	<bean id="messageListener" class="com.spring.EMailConsumer" />
    
    	<bean id="jmsContainer"	class="org.springframework.jms.listener.DefaultMessageListenerContainer"
    		p:transactionManager-ref="txManager"  
    		p:connectionFactory-ref="amqConnectionFactory" 
    		p:messageListener-ref="messageListener" 
    		p:destinationName="QueueA" 
    		p:concurrentConsumers="10" 
    		p:receiveTimeout="300000" 
    		p:sessionTransacted="true"
    		p:recoveryInterval="300000" 
    		p:idleConsumerLimit="5" 
    		p:idleTaskExecutionLimit="1"
    		p:cacheLevelName="CACHE_CONSUMER" />
    
    </beans>
    I am using latest versions of JDK, Tomcat, Spring, Hibernate, Apache MQ.

    Thanks,
    Vivek.

  • #2
    This doesn't really belong in the Spring Integration forum.

    Memory leak detection can be hard. There are some good pointers to tools here http://stackoverflow.com/questions/1...etection-tools

    I usually can figure it out with VisualVM.

    Comment


    • #3
      Thanks Gary.. I could fix it by changing configuration settings.

      Comment

      Working...
      X