[
https://issues.jboss.org/browse/ISPN-1822?page=com.atlassian.jira.plugin....
]
Martin Gencur edited comment on ISPN-1822 at 9/14/12 8:20 AM:
--------------------------------------------------------------
Hmm, it seems that setting lower max entries limit on IBM JDK does not help. I did the
following change in BoundedConcurrentHashMap but the number of entries in the cache was
still exceeded during the test:
{code:java}
int previousPowerOfTwo = 0; //new line
while (cap < c) {
previousPowerOfTwo = cap; //new line
cap <<= 1;
}
...
for (int i = 0; i < this.segments.length; ++i) {
this.segments[i] = new Segment<K, V>(cap, previousPowerOfTwo /*changed param*/,
DEFAULT_LOAD_FACTOR, evictionStrategy, evictionListener);
}
{code}
The cap parameter sets the size of a segment and previousPowerOfTwo sets the limit when
eviction should be executed. The previousPowerOfTwo is always lower and what was there
previously but setting this limit to a lower number does not help. There are still more
entries in the cache that should be.
was (Author: mgencur):
Hmm, it seems that setting lower max entries limit on IBM JDK does not help. I did the
following change in
BoundedConcurrentHashMap but the number of entries in the cache was still exceeded during
the test:
{code:java}
int previousPowerOfTwo = 0; //new line
while (cap < c) {
previousPowerOfTwo = cap; //new line
cap <<= 1;
}
...
for (int i = 0; i < this.segments.length; ++i) {
this.segments[i] = new Segment<K, V>(cap, previousPowerOfTwo /*changed param*/,
DEFAULT_LOAD_FACTOR, evictionStrategy, evictionListener);
}
{code}
The cap parameter sets the size of a segment and previousPowerOfTwo sets the limit when
eviction should be executed.
The previousPowerOfTwo is always lower and what was there previously but setting this
limit to a lower number does not
help. There are still more entries in the cache that should be.
Cache entry not evicted from memory on IBM JDK when another entry was
loaded from a cache loader and maxEntries had been reached
--------------------------------------------------------------------------------------------------------------------------------
Key: ISPN-1822
URL:
https://issues.jboss.org/browse/ISPN-1822
Project: Infinispan
Issue Type: Bug
Components: Eviction
Affects Versions: 5.1.0.FINAL
Environment: java version "1.6.0"
Java(TM) SE Runtime Environment (build pxi3260sr9fp1-20110208_03(SR9 FP1))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr9-20110203_74623 (JIT
enabled, AOT enabled) ;
java version "1.7.0"
Java(TM) SE Runtime Environment (build pxi3270-20110827_01)
IBM J9 VM (build 2.6, JRE 1.7.0 Linux x86-32 20110810_88604 (JIT enabled, AOT enabled)
Reporter: Martin Gencur
Assignee: Martin Gencur
Fix For: 5.2.0.Final
This behavior is specific to IBM JDK (I tried JDK6 and 7), it works fine with Java
HotSpot.
Steps to reproduce the problem:
1) set maxEntries for eviction to 2 and algorithm e.g. to LRU
2) store 3 entries key1, key2, key3 to the cache (after that you can see that the cache
contains only 2 entries - key2 and key3, the first one was evicted from memory)
3) call cache.get("key1")
4) PROBLEM - cache contains all key1, key2, key3 even though it should contain only 2
entries - only happens with IBM JDK (6 or 7 ..no matter)
I'll shortly issue a pull request with a test to ispn-core
--
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