public class SizeEstimator extends Object implements Logging
Based on the following JavaWorld article: http://www.javaworld.com/javaworld/javaqa/2003-12/02-qa-1226-sizeof.html
|Constructor and Description|
|Modifier and Type||Method and Description|
Estimate the number of bytes that the given object takes up on the JVM heap.
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static long estimate(Object obj)
This is useful for determining the amount of heap space a broadcast variable will occupy on each executor or the amount of space each object will take when caching objects in deserialized form. This is not the same as the serialized size of the object, which will typically be much smaller.