public int lengthForRandom() {
    // boolean + double + AtomicLong
    return object() + primitive1() + primitive2() + object() + primitive2();
  }
Estimation of memory footprint of object
storage-api/src/java/org/apache/hadoop/hive/ql/util/JavaDataModel.java