You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by easyl <ea...@gmail.com> on 2010/04/29 10:39:53 UTC

ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

AMQ 5.3 in Geronimo 2.2

I found ActiveMQConnection always hold the ActiveMQTempQueue and should lead
to memory leak,
especially using massive send/reply through temp queues.

I create a ticket here https://issues.apache.org/activemq/browse/AMQ-2716

-- 
View this message in context: http://old.nabble.com/ActiveMQConnection-leaks-memory-by-caching-ActiveMQTempQueue-objects-tp28397951p28397951.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

Posted by Ivan Pechorin <iv...@gmail.com>.
> what I cannot understand is that why those ActiveMQTempQueue are always
> there even I close the connection.

Because the connection is not closed actually, it is just returned to the pool.

If I understand correctly, the following kinds of ActiveMQ objects
involve sync request to ActiveMQ broker each time they are created:
1) connection
2) session
3) destination
4) producer
5) consumer

Therefore, we pool all of these objects, not just connections.

Re: ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

Posted by easyl <ea...@gmail.com>.
Hallo,

I did not pool the AMQ connection by myself, but setting a pool in Geronimo
for AMQ.
Therefore I can understand why there are always some ActiveMQConnection
staying in memory.



> <conn:resourceadapter>
>   <conn:resourceadapter-instance>
>     <conn:resourceadapter-name>jmsResources</conn:resourceadapter-name>
>     <conn:config-property-setting
> name="ServerUrl">tcp://localhost:61616?keepAlive=true&amp;jms.copyMessageOnSend=false&amp;jms.watchTopicAdvisories=false&amp;socket.tcpNoDelay=true&amp;wireFormat.tcpNoDelayEnabled=true</conn:config-property-setting>
>     <nam:workmanager>
>       <nam:gbean-link>DefaultWorkManager</nam:gbean-link>
>     </nam:workmanager>
>   </conn:resourceadapter-instance>
>   <conn:outbound-resourceadapter>
>     <conn:connection-definition>
>      
> <conn:connectionfactory-interface>javax.jms.ConnectionFactory</conn:connectionfactory-interface>
>       <conn:connectiondefinition-instance>
>         <conn:name>jmsCF</conn:name>
>        
> <conn:implemented-interface>javax.jms.QueueConnectionFactory</conn:implemented-interface>
>         <conn:connectionmanager>
>           <conn:xa-transaction>
>             <conn:transaction-caching />
>           </conn:xa-transaction>
>           <conn:single-pool>
>             <conn:max-size>150</conn:max-size>
>             <conn:min-size>70</conn:min-size>									
>            
> <conn:blocking-timeout-milliseconds>30000</conn:blocking-timeout-milliseconds>
>             <conn:match-one />
>           </conn:single-pool>
>         </conn:connectionmanager>
>       </conn:connectiondefinition-instance>
>     </conn:connection-definition>
>   </conn:outbound-resourceadapter>
> </conn:resourceadapter>
> 

the 1.5 GB objects are almost from the HashMaps, holding ActiveMQTempQueue,
referenced by those ActiveMQConnection.

what I cannot understand is that why those ActiveMQTempQueue are always
there even I close the connection.

I am trying to run different application on different JVM and let them
send/reply messages to/from each other, therefore I use TCP transport. Can I
use VM Transport across JVM, did I misunderstand the meaning of transport?


Ivan Pechorin wrote:
> 
> Hello,
> 
> 2010/4/29 easyl <ea...@gmail.com>:
>> AMQ 5.3 in Geronimo 2.2
>>
>> I found ActiveMQConnection always hold the ActiveMQTempQueue and should
>> lead
>> to memory leak,
>> especially using massive send/reply through temp queues.
>>
>> I create a ticket here https://issues.apache.org/activemq/browse/AMQ-2716
> 
> There is something I don't get: in the ticket you wrote:
> 1) "the ActiveMQConnections are pooled"? and
> 2) "The 1.5G ActiveMQConnection objects and their referencing objects
> stay in heap old generation and cannot be cleaned by GC."
> 
> If you do really pool your connections, how do you manage to create
> the 1.5 GB of connection objects?
> 
> By the way, why do you use TCP transport for connection to embedded
> ActiveMQ? Why not use VM transport, designed for exactly this purpose?
> 
> Best regards, Ivan
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQConnection-leaks-memory-by-caching-ActiveMQTempQueue-objects-tp28397951p28398408.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

Posted by Ivan Pechorin <iv...@gmail.com>.
Hello,

2010/4/29 easyl <ea...@gmail.com>:
> AMQ 5.3 in Geronimo 2.2
>
> I found ActiveMQConnection always hold the ActiveMQTempQueue and should lead
> to memory leak,
> especially using massive send/reply through temp queues.
>
> I create a ticket here https://issues.apache.org/activemq/browse/AMQ-2716

There is something I don't get: in the ticket you wrote:
1) "the ActiveMQConnections are pooled"? and
2) "The 1.5G ActiveMQConnection objects and their referencing objects
stay in heap old generation and cannot be cleaned by GC."

If you do really pool your connections, how do you manage to create
the 1.5 GB of connection objects?

By the way, why do you use TCP transport for connection to embedded
ActiveMQ? Why not use VM transport, designed for exactly this purpose?

Best regards, Ivan