Class DefaultObjectSizeEstimator

java.lang.Object
org.jboss.netty.util.DefaultObjectSizeEstimator
All Implemented Interfaces:
ObjectSizeEstimator
Direct Known Subclasses:
AbstractTrafficShapingHandler.SimpleObjectSizeEstimator

public class DefaultObjectSizeEstimator extends Object implements ObjectSizeEstimator
The default ObjectSizeEstimator implementation for general purpose.
  • Field Details

  • Constructor Details

    • DefaultObjectSizeEstimator

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

    • estimateSize

      public int estimateSize(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(Class<?> clazz, Set<Class<?>> visitedClasses)
    • align

      private static int align(int size)