Package org.github.jamm
Class Filters
java.lang.Object
org.github.jamm.Filters
Utility class providing the different filters used by
MemoryMeter-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FieldFilterFilter excluding some of the fields from sun.misc.Cleaner as they should not be taken into account.static final FieldAndClassFilterFilter excluding class such asEnum,Class,ClassLoaderandAccessControlContextstatic final FieldFilterFilter excluding all the Reference's fields and theheadfield ofReferenceQueue.static final FieldFilterFilter excluding the outer class reference from non-static inner classes.static final FieldFilterFilter excluding static and primitive fieldsstatic final FieldFilterFilter excluding thegroupfield from thread classes as that field holds the references to all the other threads from the group to which the thread belongs.static final FieldAndClassFilterFilter excluding fields and class annotated withUnmetered -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldAndClassFiltergetClassFilters(boolean ignoreKnownSingletons) static FieldFiltergetFieldFilters(boolean ignoreKnownSingletons, boolean ignoreOuterClassReference, boolean ignoreNonStrongReferences)
-
Field Details
-
IGNORE_STATIC_AND_PRIMITIVE_FIELDS
Filter excluding static and primitive fields -
IGNORE_KNOWN_SINGLETONS
Filter excluding class such asEnum,Class,ClassLoaderandAccessControlContext -
IGNORE_NON_STRONG_REFERENCES
Filter excluding all the Reference's fields and theheadfield ofReferenceQueue. The Reference fieldsnextanddiscoveredare used byReferenceQueueinstances to create a linked list and are not part of what we want to measure. Thequeuefield is either a singletonReferenceQueue.NULLor a provided queue that user hold a reference to and therefore should be ignored too. To be consistent, theheadfield ofReferenceQueueis also ignored to fully decouple queue and references. -
IGNORE_CLEANER_FIELDS
Filter excluding some of the fields from sun.misc.Cleaner as they should not be taken into account. The fields being excluded are:- queue: as it is a dummy queue referenced by all Cleaner instances.
- next and prev: as they are used to create a doubly-linked list of live cleaners and therefore refer to other Cleaners instances
-
IGNORE_THREAD_FIELDS
Filter excluding thegroupfield from thread classes as that field holds the references to all the other threads from the group to which the thread belongs. -
IGNORE_OUTER_CLASS_REFERENCES
Filter excluding the outer class reference from non-static inner classes. In practice that filter is only useful if the top class is an inner class, and we wish to ignore the outer class in the measurement. -
IGNORE_UNMETERED_FIELDS_AND_CLASSES
Filter excluding fields and class annotated withUnmetered
-
-
Method Details
-
getClassFilters
-
getFieldFilters
public static FieldFilter getFieldFilters(boolean ignoreKnownSingletons, boolean ignoreOuterClassReference, boolean ignoreNonStrongReferences)
-