Uploaded image for project: 'CXF Distributed OSGi'
  1. CXF Distributed OSGi
  2. DOSGI-210

Service registration and memory leaks

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0, 1.6.0
    • Fix Version/s: 1.6.0
    • Component/s: common
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      While doing some memory profiling on a custom application using DOSGi, I noticed after a while there were many existing ZooKeeper instances, with their references being held by multiple registered PublishingEndpointListenerFactory services and some LocalDiscovery references too. Further investigation found several issues:

      1. PublishingEndpointListenerFactory was registered as a service when started, but did not unregister the service when stopped (the bundle itself does not get deactivated, so there's no automatic unregistering).

      2. ZookeeperDiscovery was re-creating a new instance of PublishingEndpointListenerFactory (and the rest of its implementation classes, registrations, etc.) whenever it received a ZooKeeper SyncConnected event, however these can be received more than once in a row (e.g. with a unhandled Disconnected event in between), thus leaking copies of everything it initializes.

      3. LocalDiscovery was missing synchronization code, and also had a little memory leak (filter strings of removed endpoint listeners were never removed from its internal data structures).

      All issues are now fixed, and these memory/service leaks no longer occur.

        Attachments

          Activity

            People

            • Assignee:
              amichai Amichai Rothman
              Reporter:
              amichai Amichai Rothman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: