Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Store.free() method is invoked in loop by StoreJanitor, this usually lead to slow execution of cache freeing. For example, EHDefaultStore has a free method implemented as:
...
final List keys = this.cache.getKeysNoDuplicateCheck();
if (!keys.isEmpty()) {
final Serializable key = (Serializable) keys.get(0);
...
Where method getKeysNoDuplicateCheck() takes quite some time (and memory) and is dependent on the size of memory and disk stores. Because free() is run in loop this method is invoked each time! If free(int) method would exists, then each store could implement it in an optimal way.
...
final List keys = this.cache.getKeysNoDuplicateCheck();
if (!keys.isEmpty()) {
final Serializable key = (Serializable) keys.get(0);
...
Where method getKeysNoDuplicateCheck() takes quite some time (and memory) and is dependent on the size of memory and disk stores. Because free() is run in loop this method is invoked each time! If free(int) method would exists, then each store could implement it in an optimal way.