[
http://jira.jboss.com/jira/browse/JBCACHE-11?page=all ]
Alexandre Russel updated JBCACHE-11:
------------------------------------
Attachment: memoryBaseEviction.txt
Hi,
a patch not meant to be comited but to get things started.
the idea is to separate:
when is there eviction => decided by EvictionTask.
which node is evicted => decided by the algorithm.
how many are evicted => decided by the number of nodes in the cache.
The patch keep the algoritm. It creates an abstract class EvictionTask,
with 2 child EvictionTimerTask (the previous EvictionTask) and
EvictionMemoryTask (a new EvictionTask based on memory).
I added setter and getter on EvictionPolicyConfig for maxNodes.
The EvictionMemoryTask listen to the memory pool that support usage threshold
and that matches a regexp given in config.
It accept 2 settings, a minimum and a maximum percentage of memory.
When there is a notification that the first minimum of memory is
exceded, the maximum number of nodes is set to half its value.
If it goes over the maximum percentage the maximum number of nodes goes to 1.
I used sun's jvm. If you run the test, you may want to check the number
of objects put in the list. It was set to be a raisonable value on my
computer.
If you think it is a good way to add memory based eviction, let me know
and I'll improve on it. (Few improvements would be to be able to increment
max nodes when memory is back to a low value and have more than just 2 values
max and min)
alex
Memory based eviction policy
----------------------------
Key: JBCACHE-11
URL:
http://jira.jboss.com/jira/browse/JBCACHE-11
Project: JBoss Cache
Issue Type: Feature Request
Components: Eviction
Reporter: Bela Ban
Assigned To: Mircea Markus
Fix For: 2.1.0.GA
Attachments: memoryBaseEviction.txt
Original Estimate: 2 weeks
Remaining Estimate: 2 weeks
(maybe only in JDK 1.5, which has
triggers for low memory)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira