public static final class WicketObjects.SerializingObjectSizeOfStrategy extends Object implements WicketObjects.IObjectSizeOfStrategy
WicketObjects.IObjectSizeOfStrategy
that works by serializing the object to an instance of
ByteCountingOutputStream
, which records the number of bytes written to it. Hence,
this gives the size of the object as it would be serialized,including all the overhead of
writing class headers etc. Not very accurate (the real memory consumption should be lower)
but the best we can do in a cheap way pre JDK 5.Constructor and Description |
---|
SerializingObjectSizeOfStrategy() |
Modifier and Type | Method and Description |
---|---|
long |
sizeOf(Serializable object)
Computes the size of an object.
|
public long sizeOf(Serializable object)
WicketObjects.IObjectSizeOfStrategy
sizeOf
in interface WicketObjects.IObjectSizeOfStrategy
object
- The serializable object to compute size ofCopyright © 2006–2022 Apache Software Foundation. All rights reserved.