Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/shark/ReferencePattern

ReferencePattern

sealed class ReferencePattern : Serializable

A pattern that will match references for a given ReferenceMatcher.

Inheritors

JavaLocalPattern
StaticFieldPattern
InstanceFieldPattern
NativeGlobalVariablePattern

Types

Name Summary
Companion [jvm]
object Companion
InstanceFieldPattern [jvm]
data class InstanceFieldPattern(val className: String, val fieldName: String) : ReferencePattern
Matches instances field references, identified by className and fieldName.
JavaLocalPattern [jvm]
data class JavaLocalPattern(val threadName: String) : ReferencePattern
Matches local references held in the stack of frames of a given thread, identified by its name.
NativeGlobalVariablePattern [jvm]
data class NativeGlobalVariablePattern(val className: String) : ReferencePattern
Matches native global variables (also known as jni global gc roots) that reference Java objects. The class name will match against classes, instances and object arrays with a matching class name.
StaticFieldPattern [jvm]
data class StaticFieldPattern(val className: String, val fieldName: String) : ReferencePattern
Matches static field references, identified by className and fieldName.

Functions

Name Summary
ignored [jvm]
fun ReferencePattern.ignored(patternApplies: (HeapGraph) -> Boolean = ALWAYS): IgnoredReferenceMatcher
leak [jvm]
fun ReferencePattern.leak(description: String = "", patternApplies: (HeapGraph) -> Boolean = ALWAYS): LibraryLeakReferenceMatcher