[
https://issues.apache.org/jira/browse/BEANUTILS-59?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Niall Pemberton updated BEANUTILS-59:
-------------------------------------
Attachment: beanutils-59.patch
Theres 2 problems here:
1) The memory issues itself
2) The fact that the HashMap is exposed as as a protected instance which means
removing it or changing the implementation breaks binary compatibility
To resolve the memory issue I propose we put the cache(i.e. Map) inside a
static ContextClassLoaderLocal instance - that way there will be one Map per
ClassLoader in a WeakHashMap.
To resolve the binary compatibility I propose we create a HashMap
implementation with all its methods overriden to delegate to the Map instances
in the ContextClassLoaderLocal.
Attaching a patch with the proposed changes
> [beanutils] Memory leak on webapp undeploy in WrapDynaClass
> -----------------------------------------------------------
>
> Key: BEANUTILS-59
> URL: https://issues.apache.org/jira/browse/BEANUTILS-59
> Project: Commons BeanUtils
> Issue Type: Bug
> Components: DynaBean
> Affects Versions: 1.6
> Environment: Operating System: All
> Platform: All
> Reporter: Simon Kitching
> Fix For: 1.8.0
>
> Attachments: beanutils-59.patch
>
>
> Class WrapDynaClass has a HashMap dynaClasses containing a mapping from Class
> to
> WrapDynaClass. If this class were to be deployed via a shared webapp, then any
> reference in there to a class loaded via the webapp classloader will prevent
> the
> webapp classloader from being garbage-collected when the webapp is undeployed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]