Add ChronicleHash.offHeapMemoryUsed() method; Centralized management of all direct memory and file resources of ChronicleMap in one Cleaner

This commit is contained in:
leventov
2016-11-05 15:08:45 -06:00
parent 68c29c4c54
commit 9a2bb31b66
12 changed files with 478 additions and 159 deletions
@@ -52,6 +52,16 @@ public interface ChronicleHash<K, E extends HashEntry<K>, SC extends HashSegment
*/
long longSize();
/**
* Returns the amount of off-heap memory (in bytes), allocated by this {@code ChronicleHash} or
* shared with with other ChronicleHashes, persisting to the same {@link #file()}.
*
* <p>After {@link #close()} this method returns 0.
*
* @return the amount of off-heap memory, used by this {@code ChronicleHash} (in bytes)
*/
long offHeapMemoryUsed();
/**
* @return the class of {@code <K>}
*/