Class SizeEstimator


  • public final class SizeEstimator
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SizeEstimator()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long estimatedSizeOf​(java.lang.Object s)
      Estimates the size of a object in bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OBJ_HEADER

        private static int OBJ_HEADER
      • ARR_HEADER

        private static int ARR_HEADER
      • INT_FIELDS

        private static int INT_FIELDS
      • OBJ_REF

        private static int OBJ_REF
      • OBJ_OVERHEAD

        private static int OBJ_OVERHEAD
      • IS_64_BIT_JVM

        private static boolean IS_64_BIT_JVM
    • Constructor Detail

      • SizeEstimator

        private SizeEstimator()
    • Method Detail

      • estimatedSizeOf

        public static long estimatedSizeOf​(java.lang.Object s)
        Estimates the size of a object in bytes.
        Parameters:
        s - The string to estimate memory footprint.
        Returns:
        The estimated size in bytes.