Package org.jboss.netty.util
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 int
align
(int size) private int
estimateSize
(Class<?> clazz, Set<Class<?>> visitedClasses) int
Returns 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:ObjectSizeEstimator
Returns the estimated size of the specified object in bytes.- Specified by:
estimateSize
in interfaceObjectSizeEstimator
- Returns:
- a positive integer which represents the size of the specified object in bytes
-
estimateSize
-
align
private static int align(int size)
-