[ 
https://issues.apache.org/jira/browse/MYFACES-3549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13280824#comment-13280824
 ] 

Leonardo Uribe commented on MYFACES-3549:
-----------------------------------------

Ok, it is done (see MYFACES-3549-fix-hard-reference-map.patch). This ensure the 
map reference that also contains SoftReference will not be collected by the GC 
until the application stops or is undeployed. I tested it with YourKit and 
Tomcat 7, and it works well. Remember, an object is collected only when there 
are no hard references to it, so the SoftReference will not be cleared until 
the hard reference is cleared.

As long as the application is still running, the classloader will be reachable 
and the WeakHashMap holding the classloader will not be cleared too. 

Now we have all issues solved, including a very good performance in this part 
and a very nice memory handling.

Note that get the ClassLoader using:

Thread.currentThread().getContextClassLoader()

Is cheap. See this comparison I did:

http://lu4242.blogspot.com/2012/05/understandingjsf-2-and-wicket.html

You can see that 2.1.7 has better response times than 2.1.6, and that has sense 
because get context classloader only requires a variable assigment to get it.

If no objections I'll commit this code soon. Thanks a lot for the feedback, it 
is a valuable contribution.
                
> Alternative solution to bugs MYFACES-3262 and MYFACES-3510
> ----------------------------------------------------------
>
>                 Key: MYFACES-3549
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3549
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 2.1.7
>            Reporter: Jesús Pérez Alcaide (ISBAN)
>         Attachments: AAA_patch_PropertyDescriptor_MyFaces217.jar, 
> MYFACES-3549-fix-hard-reference-map.patch, 
> MyFaces3262_PropertyDescriptorHolder.patch, 
> MyFaces3510_AbstractFacesInitializer.patch, 
> MyFaces3510_ComponentAttributesMap.patch
>
>
> I would like to propose an alternative solution to bugs MYFACES-3262 and 
> MYFACES-3510, which consists in rollback the changes made in MYFACES-3510 and 
> modify the solution given in MYFACES-3262 by adding a soft reference to the 
> methods held in the class _PropertyDescriptorHolder.
> This alternative solution fixes MYFACES-3262 and avoids the performance loss 
> caused by MYFACES-3510.
> More information in this email:
> http://markmail.org/message/xh66wlte6luqn63d

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to