private static MemoryLayout getMemoryLayout() {
    // Have a safeguard in case Unsafe estimate is wrong. This is static context, there is
    // no configuration, so we look at System property.
    String enabled = System.getProperty("hbase.memorylayout.use.unsafe");
    if (
      HBasePlatformDependent.isUnsafeAvailable()
        && (enabled == null || Boolean.parseBoolean(enabled))
    ) {
      LOG.debug("Using Unsafe to estimate memory layout");
      return new UnsafeLayout();
    }
    LOG.debug("Not using Unsafe to estimate memory layout");
    return new MemoryLayout();
  }
UnsafeLayout uses Unsafe to guesstimate the object-layout related parameters like object header
sizes and oop sizes See HBASE-15950.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java