public long getLongCacheSize(){
        // The constructor asserts that the eviction policy and weightedSize are present.
        return cache.policy().eviction().get().weightedSize().getAsLong();
    }
Returns the size of the cache contents in bytes. This value is only a
rough approximation, so cache users should expect that actual VM
memory used by the cache could be significantly higher than the value
reported by this method.

@return the size of the cache contents in bytes.
xmppserver/src/main/java/org/jivesoftware/util/cache/CaffeineCache.java