public long getMemoryUsage() {
        try {
            return cache.calculateInMemorySize();
        } catch (Throwable t) {
            return -1;
        }
    }
Returns the size (in bytes) that this EhCache is using in memory (RAM), or <code>-1</code> if that
number is unknown or cannot be calculated.

@return the size (in bytes) that this EhCache is using in memory (RAM), or <code>-1</code> if that
number is unknown or cannot be calculated.
support/ehcache/src/main/java/org/apache/shiro/cache/ehcache/EhCache.java