public final class Filters extends Object
MemoryMeter| Modifier and Type | Field and Description |
|---|---|
static FieldFilter |
IGNORE_CLEANER_FIELDS
Filter excluding some of the fields from sun.misc.Cleaner as they should not be taken into account.
|
static FieldAndClassFilter |
IGNORE_KNOWN_SINGLETONS
Filter excluding class such as
Enum, Class, ClassLoader and AccessControlContext |
static FieldFilter |
IGNORE_NON_STRONG_REFERENCES
Filter excluding all the Reference's fields and the
head field of ReferenceQueue. |
static FieldFilter |
IGNORE_OUTER_CLASS_REFERENCES
Filter excluding the outer class reference from non-static inner classes.
|
static FieldFilter |
IGNORE_STATIC_AND_PRIMITIVE_FIELDS
Filter excluding static and primitive fields
|
static FieldFilter |
IGNORE_THREAD_FIELDS
Filter excluding the
group field from thread classes as that field holds the references to all the other threads from the group to which the thread belongs. |
static FieldAndClassFilter |
IGNORE_UNMETERED_FIELDS_AND_CLASSES
Filter excluding fields and class annotated with
Unmetered |
| Modifier and Type | Method and Description |
|---|---|
static FieldAndClassFilter |
getClassFilters(boolean ignoreKnownSingletons) |
static FieldFilter |
getFieldFilters(boolean ignoreKnownSingletons,
boolean ignoreOuterClassReference,
boolean ignoreNonStrongReferences) |
public static final FieldFilter IGNORE_STATIC_AND_PRIMITIVE_FIELDS
public static final FieldAndClassFilter IGNORE_KNOWN_SINGLETONS
Enum, Class, ClassLoader and AccessControlContextpublic static final FieldFilter IGNORE_NON_STRONG_REFERENCES
head field of ReferenceQueue.
The Reference fields next and discovered are used by ReferenceQueue instances to create a linked list and are not part of what
we want to measure. The queue field is either a singleton ReferenceQueue.NULL or a provided queue that user hold a reference to and therefore
should be ignored too. To be consistent, the head field of ReferenceQueue is also ignored to fully decouple queue and references.public static final FieldFilter IGNORE_CLEANER_FIELDS
public static final FieldFilter IGNORE_THREAD_FIELDS
group field from thread classes as that field holds the references to all the other threads from the group to which the thread belongs.public static final FieldFilter IGNORE_OUTER_CLASS_REFERENCES
public static final FieldAndClassFilter IGNORE_UNMETERED_FIELDS_AND_CLASSES
Unmeteredpublic static FieldAndClassFilter getClassFilters(boolean ignoreKnownSingletons)
public static FieldFilter getFieldFilters(boolean ignoreKnownSingletons, boolean ignoreOuterClassReference, boolean ignoreNonStrongReferences)
Copyright © 2023. All rights reserved.