Skip to content

LocalLoadingCache doesn't ever expand/rehash #1055

@gissuebot

Description

@gissuebot

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 + "");
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions