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

Andrzej Bialecki  commented on SOLR-9658:
-----------------------------------------

This patch implements the following:
 * adds {{maxIdleTime}} config param to {{LFUCache}} and {{LRUCache}}.
 * {{FastLRUCache}} is in the works but the eviction algorithm there is quite 
complicated and I'm not sure I fully understand it... Having said that, maybe 
we should do an additional full sweep and remove expired entries regardless of 
the existing algorithm.
 * entries are expired on {{put}}. If a cleanup thread is used in {{LFUCache}} 
then it also wakes up every {{maxIdleTime}} to expire old entries even if 
there's no {{put}}.
 * cache entries are now marked with epoch time (ns) instead of the generation 
counter. This allows us to evict entries based on real elapsed time, and using 
epoch time makes debugging somewhat easier at no additional cost compared to 
nano time.
 * unit tests

> Caches should have an optional way to clean if idle for 'x' mins
> ----------------------------------------------------------------
>
>                 Key: SOLR-9658
>                 URL: https://issues.apache.org/jira/browse/SOLR-9658
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Noble Paul
>            Assignee: Andrzej Bialecki 
>            Priority: Major
>         Attachments: SOLR-9658.patch
>
>
> If a cache is idle for long, it consumes precious memory. It should be 
> configurable to clear the cache if it was not accessed for 'x' secs. The 
> cache configuration can have an extra config {{maxIdleTime}} . if we wish it 
> to the cleaned after 10 mins of inactivity set it to {{maxIdleTime=600}}. 
> [~dragonsinth] would it be a solution for the memory leak you mentioned?



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to