public long getTotalMemoryConsumption() {
        long totalDataPagesSize = 0L;
        for (MemoryBlock dataPage : dataPages) {
            totalDataPagesSize += dataPage.size();
        }
        return totalDataPagesSize + ((longArray != null) ? longArray.memoryBlock().size() : 0L);
    }
Returns the total amount of memory, in bytes, consumed by this map's managed structures.
indexr-query-opt/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java