Package org.ehcache.sizeof.impl
Class ReflectionSizeOf
java.lang.Object
org.ehcache.sizeof.SizeOf
org.ehcache.sizeof.impl.ReflectionSizeOf
SizeOf that uses reflection to measure on heap size of object graphs
Inspired by Dr. Heinz Kabutz's Java Specialist Newsletter Issue #78
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBuilds a new SizeOf that will not filter fields and will cache reflected fieldsReflectionSizeOf
(SizeOfFilter fieldFilter) Builds a new SizeOf that will filter fields and will cache reflected fieldsReflectionSizeOf
(SizeOfFilter fieldFilter, boolean caching, boolean bypassFlyweight) Builds a new SizeOf that will filter fields -
Method Summary
Modifier and TypeMethodDescriptionprivate long
guessArraySize
(Object obj) long
Calculates the size in memory (heap) of the instance passed in, not navigating the down graphMethods inherited from class org.ehcache.sizeof.SizeOf
deepSizeOf, deepSizeOf, newInstance, newInstance
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
ReflectionSizeOf
public ReflectionSizeOf()Builds a new SizeOf that will not filter fields and will cache reflected fields- See Also:
-
ReflectionSizeOf
Builds a new SizeOf that will filter fields and will cache reflected fields- Parameters:
fieldFilter
- The filter to apply- See Also:
-
ReflectionSizeOf
Builds a new SizeOf that will filter fields- Parameters:
fieldFilter
- The filter to applycaching
- Whether to cache reflected fieldsbypassFlyweight
- whether "Flyweight Objects" are to be ignored- See Also:
-
-
Method Details