Code example for Cache

Methods: cleanUp

0
        bytesUsed.addAndGet(bytesUsedByInstance);
        memoryTrackedReferences.put(instance, bytesUsedByInstance);
    } 
     
    public long getBytesUsed() { 
        memoryTrackedReferences.cleanUp(); 
        return bytesUsed.get();
    } 
     
}