I currently see that we have
Cache.java
public static void clear() {
for (OffHeapMemoryBuffer buffer : buffers) {
buffer.clear();
}
activeBuffer = buffers.get(0);
}
OffHeapMemoryBuffer.java
public void clear() {
allocationErrors = 0;
pointers.clear();
createAndAddFirstPointer();
buffer.clear();
used.set(0);
}
buffer.clear() doesn't actually deallocate the memory. I assume currently we
dnt have the feature of de-allocating memory which means that we can't
resize the cache once instantiated even if we want to. I feel we should have
this feature which would give deeper control on the Cache.
Cheers,
Akash A