-
Notifications
You must be signed in to change notification settings - Fork 11k
Closed
Labels
Milestone
Description
Original issue created by Ionized on 2012-07-04 at 12:03 AM
No matter how many elements get loaded into the LoadingCache, expand() on the Segment never gets called (it gets called on put(), but not on getOrLoad())
The following code reproduces the issue:
CacheLoader<String, Object> loader = new CacheLoader<String, Object>() {
@Override
public Object load(String key) throws Exception {
return key + 1;
}
};
LoadingCache<String, Object> cache = CacheBuilder.newBuilder().build(
loader);
for (int i = 0; i < 100000; i++) {
cache.getUnchecked(i + "");
}