Class DefaultObjectSizeEstimator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.ConcurrentMap<java.lang.Class<?>,​java.lang.Integer> class2size  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static int align​(int size)  
      private int estimateSize​(java.lang.Class<?> clazz, java.util.Set<java.lang.Class<?>> visitedClasses)  
      int estimateSize​(java.lang.Object o)
      Returns the estimated size of the specified object in bytes.
      • Methods inherited from class java.lang.Object

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

      • class2size

        private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,​java.lang.Integer> class2size
    • Constructor Detail

      • DefaultObjectSizeEstimator

        public DefaultObjectSizeEstimator()
        Creates a new instance.
    • Method Detail

      • estimateSize

        public int estimateSize​(java.lang.Object o)
        Description copied from interface: ObjectSizeEstimator
        Returns the estimated size of the specified object in bytes.
        Specified by:
        estimateSize in interface ObjectSizeEstimator
        Returns:
        a positive integer which represents the size of the specified object in bytes
      • estimateSize

        private int estimateSize​(java.lang.Class<?> clazz,
                                 java.util.Set<java.lang.Class<?>> visitedClasses)
      • align

        private static int align​(int size)