[ 
https://issues.apache.org/jira/browse/LANG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604896#action_12604896
 ] 

Niall Pemberton commented on LANG-436:
--------------------------------------

Whoever implemented MethodUtils's caching in BeanUtils presumably did so to 
improve performance and therefore removing it could negatively affect existing 
applications - for example Struts1 users. The copy of MethodUtils here in lang 
has only recently been added - its not in a released version and therefore has 
no existing users to be concerned about. Better then IMO to just provide the 
reflection functionality here without the caching which is much cleaner.

I have done some work on the memory leak associated with the WeakHashMap 
(nothing to do with the lack of synchronization - which I agree is another 
issue, thanks for reporting it) and problem seems to be caused by the Method 
reference held in the MethodDescriptor - see BEANUTILS-291 and 
http://tinyurl.com/5ksjrh which seems to fix this.

The BEANUTILS-291 memory leak issues is still on my todo list - but its 
currently in a broken state - with the same kind of issue as BEANUTILS-318, 
caused by me replacing the FastHashMap with WeakHashMap. I need to find time to 
finish up so that we can get a BeanUtils release out with these issues resolved.

> Remove caching from MethodUtils
> -------------------------------
>
>                 Key: LANG-436
>                 URL: https://issues.apache.org/jira/browse/LANG-436
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Niall Pemberton
>            Assignee: Niall Pemberton
>             Fix For: 3.0
>
>         Attachments: LANG-436-remove-MethodUtils-caching.patch
>
>
> I think we should remove the caching from MethodUtils. This has caused memory 
> leak problems in BeanUtils (where it was copied from) and better IMO to just 
> provide the pure reflection API in lang and let downstream users provide 
> solutions for improving performance.

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

Reply via email to