int sizeof(Object object) {
    final boolean cdChangingForm = object instanceof CachedDeserializableValueWrapper;
    if (cdChangingForm) {
      object = ((CachedDeserializableValueWrapper) object).getValue();
    }
    if (object == null || object == Token.INVALID || object == Token.LOCAL_INVALID
        || object == Token.DESTROYED || object == Token.TOMBSTONE) {
      return 0;
    }

    int size;
    // Shouldn't we defer to the user's object sizer for these things?
    if (object instanceof byte[] || object instanceof String) {
      size = ObjectSizer.DEFAULT.sizeof(object);
    } else if (object instanceof Sizeable) {
      size = ((Sizeable) object).getSizeInBytes();
    } else if (sizer != null) {
      size = sizer.sizeof(object);
    } else {
      size = ObjectSizer.DEFAULT.sizeof(object);
    }
    if (cdChangingForm) {
      size += CachedDeserializableFactory.overhead();
    }
    return size;
  }
Return the size of an object as stored in GemFire. Typically this is the serialized size in
bytes.
geode-core/src/main/java/org/apache/geode/internal/cache/eviction/SizeLRUController.java