cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1621) Memory Leak in WSDLManagerImpl - SchemaCacheMap
Date Tue, 10 Jun 2008 20:57:45 GMT

    [ https://issues.apache.org/jira/browse/CXF-1621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604037#action_12604037
] 

Daniel Kulp commented on CXF-1621:
----------------------------------


Bharath,

This caused a NPE when building the system tests on a couple a my machines.   Basically, the
CORBA utils have the manager create a Definition and a builder then builds the schemas and
stuff for it and add to the cache.  However, the builder is discarded so nothing at all was
holding onto the Schemas strongly and they got garbage collected before the CORBA utils could
grab them.  Not all machines, but it did on my Mac.  :-)

I flipped the schemaCache to using the same keys as the definitionsCache.   That fixed that.

However, after I did that, I discovered the ServiceInfo in the SchemaInfo was never used at
all.   It wasn't needed.  Thus, I yanked it.   That should also fix it.

In anycase, I'd appreciate a verification.  



> Memory Leak in WSDLManagerImpl - SchemaCacheMap
> -----------------------------------------------
>
>                 Key: CXF-1621
>                 URL: https://issues.apache.org/jira/browse/CXF-1621
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1, 2.0.6
>            Reporter: Bharath Ganesh
>            Assignee: Bharath Ganesh
>             Fix For: 2.1.1, 2.0.7
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message