[JAVA-141] MBean not unregistered when DBPortPool is closed Created: 30/Jul/10  Updated: 29/Oct/10  Resolved: 30/Jul/10

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 2.0
Fix Version/s: 2.0

Type: Bug Priority: Major - P3
Reporter: Daniel Spilker Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.


Generated at Thu Feb 08 08:51:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.