You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2008/05/07 15:56:55 UTC
[jira] Created: (LANG-436) Remove caching from MethodUtils
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
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.
[jira] Updated: (LANG-436) Remove caching from MethodUtils
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton updated LANG-436:
---------------------------------
Attachment: LANG-436-remove-MethodUtils-caching.patch
Attaching a patch to remove caching from MethodUtils, which I plan to apply
> 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
> 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.
[jira] Commented: (LANG-436) Remove caching from MethodUtils
Posted by "Erik Voorbraak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604782#action_12604782 ]
Erik Voorbraak commented on LANG-436:
-------------------------------------
So you removed caching for org.apache.commons.lang.reflect.MethodUtils.java. Should the same not also happen for org.apache.commons.beanutils/MethodUtils.java? This is where I discovered a memory leak today.
As far as I can see, it uses a WeakHashMap, whose keys are weak references. However, the map is filled with MethodDescriptor instances, which are created in the same method as where they are put as keys in the map. So one would expect that the get garbage collected on the first occasion. It looks like the cache should have been one where the values are weak. Why we still had the memory leak, I cannot explain.
> 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.
[jira] Commented: (LANG-436) Remove caching from MethodUtils
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (LANG-436) Remove caching from MethodUtils
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton updated LANG-436:
---------------------------------
Fix Version/s: (was: 3.0)
2.5
> Remove caching from MethodUtils
> -------------------------------
>
> Key: LANG-436
> URL: https://issues.apache.org/jira/browse/LANG-436
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.reflect.*
> Reporter: Niall Pemberton
> Assignee: Niall Pemberton
> Fix For: 2.5
>
> 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.
[jira] Resolved: (LANG-436) Remove caching from MethodUtils
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton resolved LANG-436.
----------------------------------
Resolution: Fixed
Fix Version/s: 3.0
OK removed
http://svn.apache.org/viewvc?view=rev&revision=654159
> 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.
[jira] Commented: (LANG-436) Remove caching from MethodUtils
Posted by "Matt Benson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594951#action_12594951 ]
Matt Benson commented on LANG-436:
----------------------------------
I have no problems with this. Apply away! Thanks, Niall!
> 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
> 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.