Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-141

MBean not unregistered when DBPortPool is closed

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0
    • 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.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            daspilker Daniel Spilker
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: