private long sizeOf(Object[] objects) {
    if (objects == null) {
      return 0;
    }

    return Arrays.stream(objects)
        .filter(Objects::nonNull)
        .mapToLong(
            object -> {
              if (object.getClass().isArray()) {
                return sizeOf((Object[]) object);
              } else {
                return RamUsageEstimator.sizeOfObject(object, 0);
              }
            })
        .sum();
  }
Size Estimator for StructLikeWrapper record payload.
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/map/StructLikeWrapperSizeEstimator.java