[infinispan-issues] [JBoss JIRA] (ISPN-863) Eviction based on JVM memory utilization

Robert Stupp (JIRA) jira-events at lists.jboss.org
Thu Aug 30 15:03:34 EDT 2012


    [ https://issues.jboss.org/browse/ISPN-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714944#comment-12714944 ] 

Robert Stupp commented on ISPN-863:
-----------------------------------

I have got some experiences with memory (heap) based eviction. Eviction based on freeMemory()/totalMemory() is too simple - just because you might not be the only thing inside a JVM. And even if you evict the objects (no more references to the objects) the GC might not collect that garbage right when you "think" it does - this process is too complicated as it could be reflected into some simple and fast piece of code - just think about in which generation the evicted objects were (new gen is collected more often as eden space for example) and which types of GC you are currently using.
The only solution I imagine is to specify some kind of "occupied heap" settings. There are two solutions that might work:
* Estimate the size of an object (graph) by using reflection - expensive
* Estimate the size of an object graph using serialization - expensive - but ISPN already performs serialization - it would be possible to remember the serialized size (if using Java serialization)
* Estimate the size using Java's Instrumentation interface - not suitable but possible and not that expensive - but might cause conflicts when using profilers

                
> Eviction based on JVM memory utilization
> ----------------------------------------
>
>                 Key: ISPN-863
>                 URL: https://issues.jboss.org/browse/ISPN-863
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Eviction
>    Affects Versions: 4.2.0.Final
>         Environment: N/A
>            Reporter: Dave Marion
>            Assignee: Manik Surtani
>            Priority: Blocker
>              Labels: eviction, threshold
>             Fix For: 5.2.0.Alpha3, 5.2.0.Final
>
>
> Allow user to specify percentage threshold upon which eviction will kick in and begin evicting entries based on the specified strategy. This would allow user to create a cache that will attempt to keep as many entries in memory as possible without having to specify maxEntries.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list