Class DefaultObjectSizeEstimator
java.lang.Object
org.jboss.netty.util.DefaultObjectSizeEstimator
- All Implemented Interfaces:
ObjectSizeEstimator
- Direct Known Subclasses:
AbstractTrafficShapingHandler.SimpleObjectSizeEstimator
The default
ObjectSizeEstimator implementation for general purpose.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intalign(int size) private intestimateSize(Class<?> clazz, Set<Class<?>> visitedClasses) intReturns the estimated size of the specified object in bytes.
-
Field Details
-
class2size
-
-
Constructor Details
-
DefaultObjectSizeEstimator
public DefaultObjectSizeEstimator()Creates a new instance.
-
-
Method Details
-
estimateSize
Description copied from interface:ObjectSizeEstimatorReturns the estimated size of the specified object in bytes.- Specified by:
estimateSizein interfaceObjectSizeEstimator- Returns:
- a positive integer which represents the size of the specified object in bytes
-
estimateSize
-
align
private static int align(int size)
-