public class UnsafeSizeOf extends SizeOf
Unsafe.theUnsafe
based sizeOf measurement
All constructors will throw UnsupportedOperationException if theUnsafe isn't accessible on this platformModifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOGGER |
private static sun.misc.Unsafe |
UNSAFE |
Constructor and Description |
---|
UnsafeSizeOf()
Builds a new SizeOf that will not filter fields and will cache reflected fields
|
UnsafeSizeOf(SizeOfFilter filter)
Builds a new SizeOf that will filter fields according to the provided filter and will cache reflected fields
|
UnsafeSizeOf(SizeOfFilter filter,
boolean caching)
Builds a new SizeOf that will filter fields according to the provided filter
|
Modifier and Type | Method and Description |
---|---|
long |
sizeOf(java.lang.Object obj)
Calculates the size in memory (heap) of the instance passed in, not navigating the down graph
|
deepSizeOf
private static final org.slf4j.Logger LOGGER
private static final sun.misc.Unsafe UNSAFE
public UnsafeSizeOf() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- If Unsafe isn't accessibleUnsafeSizeOf(net.sf.ehcache.pool.sizeof.filter.SizeOfFilter, boolean)
public UnsafeSizeOf(SizeOfFilter filter) throws java.lang.UnsupportedOperationException
filter
- The filter to applyjava.lang.UnsupportedOperationException
- If Unsafe isn't accessibleUnsafeSizeOf(net.sf.ehcache.pool.sizeof.filter.SizeOfFilter, boolean)
,
SizeOfFilter
public UnsafeSizeOf(SizeOfFilter filter, boolean caching) throws java.lang.UnsupportedOperationException
filter
- The filter to applycaching
- whether to cache reflected fieldsjava.lang.UnsupportedOperationException
- If Unsafe isn't accessibleSizeOfFilter