[
https://issues.apache.org/jira/browse/AMQ-5447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shi Lei updated AMQ-5447:
-------------------------
Description:
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 reached from the 2
threads, JDBCPersistenceAdapter has a field point to BrokerService. So the
instance of BrokerService can be reached 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.
was:
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.
> 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
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> 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 reached from the
> 2 threads, JDBCPersistenceAdapter has a field point to BrokerService. So the
> instance of BrokerService can be reached 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)