@Override
    public int getCachedSize() throws CannotCalculateSizeException
    {
        int size = CacheSizes.sizeOfObject(); // overhead of the class itself.
        size += (9 * CacheSizes.sizeOfBoolean()); // nine boolean properties.
        size += (3 * CacheSizes.sizeOfInt()); // three int properties.
        size += (4 * CacheSizes.sizeOfObject()); // 4 references to other classes / enums
        size += CacheSizes.sizeOfString( language );
        return size;
    }
Returns the approximate size of the Object in bytes. The size should be
considered to be a best estimate of how much memory the Object occupies
and may be based on empirical trials or dynamic calculations.<p>

@return the size of the Object in bytes.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/DefaultNodeConfiguration.java