You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Shi Lei (JIRA)" <ji...@apache.org> on 2014/11/21 08:32:33 UTC

[jira] [Created] (AMQ-5447) Memory Leak after shutdown embeded broker with JDBC persistence

Shi Lei created AMQ-5447:
----------------------------

             Summary: Memory Leak after shutdown embeded broker with JDBC persistence
                 Key: AMQ-5447
                 URL: https://issues.apache.org/jira/browse/AMQ-5447
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker, Message Store
    Affects Versions: 5.10.0
         Environment: Windows7, JDK7
            Reporter: Shi Lei


After shutdown embeded activemq broker with JDBC store, 2 'ActiveMQ JDBC PA Scheduled Task' is still alive.
Because the 2 thread's Thread factory is object of JDBCPersistenceAdapter's inner class, so the object of JDBCPersistenceAdapter can be referenced from the 2 threads, JDBCPersistenceAdapter has a field point to BrokerService. So the instance of BrokerService can be referenced from the 2 threads.

So the stopped brokerService cannot be GC.

The root cause is that when stopping JDBCPersistenceAdapter, only cancelling cleanupTicket without shutdown clockDaemon, that's why the 2 threads are still alive.

According to http://activemq.apache.org/how-do-i-restart-embedded-broker.html, it's better (more reliable) to instantiate the broker again instead of reuse old broker. So if I restart embeded broker, there will be  1 more BrokerService in memory. I think it's memory leak.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)