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

Carsten Ziegeler commented on SLING-7154:
-----------------------------------------

We had a LRU cache initially but had to remove it as it was not efficient 
either. Users having a lot of selectors are basically challenging the LRU cache 
as the next request puts a new entry in the cache and this goes on endlessly as 
the number of combinations is way to high.

Now, I think I've said this in other places as well already, the way the cache 
works today is absolutely not optimal and instead of putting smaller things 
here and there we should completely rethink the way the cache works. I've a 
concept which does a reverse approach to what we have today and that approach 
should be able to cache all resolutions in a more memory efficient way. But 
this requires some work

> SlingServletResolver should use a LRU map to cache resolved servlets
> --------------------------------------------------------------------
>
>                 Key: SLING-7154
>                 URL: https://issues.apache.org/jira/browse/SLING-7154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Servlets
>    Affects Versions: Servlets Resolver 2.4.14
>            Reporter: Jörg Hoh
>
> The ServletResolver currently uses a simple Map to hold the resolved 
> servlets; when reached the cache is full, it does not purge old/unused 
> entries, but just warns (once!), and then silently bypasses the cache and 
> resolves the script again.
> It should rather use a LRU cache to hold recently resolved servlets, which 
> makes it possible to adapt to the current workload instead of being stuck to 
> the workload during the filling of the cache.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to