[ 
https://issues.apache.org/jira/browse/WICKET-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868564#action_12868564
 ] 

Stefan Fussenegger commented on WICKET-2875:
--------------------------------------------

Hi Igor, thanks for your quick reaction. As a marginal note, just let me say 
that this is hardly a duplicate of WICKET-2741. I simply created a patch that 
fixes both to make it easier to apply as both affected the same class. 

Actually, I think that this bug is server enough to legitimate an early release 
of 1.4.9. While troubleshooting (debugging, profiling, analyzing tread dumps, 
...) I found that this bug caused Injector to be one of the hottest parts of 
that application, only excelled by DB and Lucene operations. Looks like 
creating hundreds of ConcurrentHashMaps along with as many scans of all fields 
for @SpringBean for each and every rendered page really is a slight performance 
killer :)

Long story short: I'd really love to see 1.4.9 instead of creating and rolling 
out a patched build myself. What is missing in order to get it? I'd rather 
spend my time submitting another patch if this speeds up the process.

> Heavily Broken Caching in Injector
> ----------------------------------
>
>                 Key: WICKET-2875
>                 URL: https://issues.apache.org/jira/browse/WICKET-2875
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8
>         Environment: current trunk version
>            Reporter: Stefan Fussenegger
>            Assignee: Igor Vaynberg
>         Attachments: wicket-2875.patch
>
>
> The caching implementation in org.apache.wicket.injection.Injector is heavily 
> broken. for each (!) component, a ConcurrentHashMap is created and 
> findFields(..) get called. This happens as a new container is created for 
> every yet unknown class instead of yet unknown ClassLoaders.
> this is the erroneous code:
> // try cache
> ConcurrentHashMap<String, Field[]> container = 
> cache.get(clazz.getClassLoader());
> if (container != null)
> {
>       fields = container.get(clazz.getName());
> }
> if (fields == null)
> {
>       fields = findFields(clazz, factory);
>       // write to cache
>       container = new ConcurrentHashMap<String, Field[]>();
>       container.put(clazz.getName(), fields);
>       cache.put(clazz.getClassLoader(), container);
> }
> By the way: This bug was introduced with the fix of WICKET-625 in revision 
> 830070 dated 0ct 27, 2009

-- 
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