Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1621

Memory Leak in WSDLManagerImpl - SchemaCacheMap

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.0.6
    • Fix Version/s: 2.1.1, 2.0.7
    • Component/s: Core
    • Labels:
      None

      Description

      The schemaCacheMap in WSDLManagerImpl has a weak key - WSDLDefinition and value ServiceSchemaInfo. A key,value pair is inserted into this map while building a service. The entry is never explicitly removed from this map. Since the map is a WeakHashMap, it is assumed that when the key WSDLDefinition is weakly referenced, the entry would be removed from the map. But it is seen that the value ServiceSchemaInfo(the value) holds on to a SchemaInfo which in turn holds on to the ServiceInfo, which holds the WSDLDefinition through the AbstractPropertiesHolder.
      This would mean that the value of the CacheMap always strongly refers to the key, which would mean the entry would never be removed from the map.
      "The value objects in a WeakHashMap are held by ordinary strong references. Thus care should be taken to ensure that value objects do not strongly refer to their own keys, either directly or indirectly, since that will prevent the keys from being discarded"

      This would mean ServiceInfo, OperationInfo, BindingInfo, WSDLDefinition would all stay in the VM even after the endpoint is stopped.

        Attachments

          Activity

            People

            • Assignee:
              bharathganesh Bharath Ganesh
              Reporter:
              bharathganesh Bharath Ganesh
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: