struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dekany (Commented) (JIRA)" <>
Subject [jira] [Commented] (WW-3766) remove struts.freemarker.mru.max.strong.size from
Date Sun, 26 Feb 2012 08:45:46 GMT


Daniel Dekany commented on WW-3766:

Access to MruCacheStorage is serialized by its caller (TemplateCache) when getting/adding/removing
an entry, as it doesn't implement synchronization itself. (This stands for all CacheStorage
implementations that doesn't mark itself as thread-safe.) But all of those operations should
take a very short time, since they never involve I/O or template parsing or anything heavy.
A CacheStorages is really just a simple associative array. It's just like having a synchronized(myMap)
{ myMap.get(key); } somewhere in your code. I would be surprised if this is something that
is a bottleneck in any real-world application. So what seems to be the problem exactly?
> remove struts.freemarker.mru.max.strong.size from
> --------------------------------------------------------------------
>                 Key: WW-3766
>                 URL:
>             Project: Struts 2
>          Issue Type: Improvement
>            Reporter: zhouyanming
>            Priority: Critical
>              Labels: freemarker
> if struts.freemarker.mru.max.strong.size > 0 ,freemarker will use MruCacheStorage
instead of SoftCacheStorage,and MruCacheStorage is not concurrent,it will synchronized on
every call,it will affect performance. 
> in TemplateCache:
>         CachedTemplate cachedTemplate;
>         if(isStorageConcurrent) {
>             cachedTemplate = (CachedTemplate)storage.get(tk);
>         }
>         else {
>             synchronized(storage) {
>                 cachedTemplate = (CachedTemplate)storage.get(tk);
>             }
>         }
> please remove struts.freemarker.mru.max.strong.size from lets developers
make their own choice.
> a better solution is implements a concurrent MruCacheStorage for struts2

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message