public abstract long getObjectSize (Object objectToSize)

Returns an implementation-specific approximation of the amount of storage consumed by the specified object. The result may include some or all of the object's overhead, and thus is useful for comparison within an implementation but not between implementations. The estimate may change during a single invocation of the JVM.

Parameters:
objectToSize    the object to size

Returns:  an implementation-specific approximation of the amount of storage consumed by the specified object

Exceptions:
java.lang.NullPointerException    if the supplied Object is null.