-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.0
-
Component/s: None
-
Labels:None
When a new DBPortPool is created, a MBean is registered. But when the pool is closed, the MBean is not unregistered. As a consequence the JMX console shows "dead" MBeans after pools are being closed. When undeploying a MongoDB application in a JEE or OSGI environment, the application can not be removed by the runtime because the Platform MBean Server holds a reference to the DBPortPool MBeans. This causes a memory leak because the application classes can not be garbage collected.
I created a patch to unregister the MBeans when closing the DBPortPool. Please have a look at http://github.com/daspilker/mongo-java-driver/commit/05d92bcede004190d8a8ebf15ee2e8991b62c1c7.