Code example for Cache

Methods: put

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