Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/shark/LibraryLeakReferenceMatcher

LibraryLeakReferenceMatcher

[jvm]\ data class LibraryLeakReferenceMatcher(val pattern: ReferencePattern, val description: String = "", val patternApplies: (HeapGraph) -> Boolean = ALWAYS) : ReferenceMatcher

LibraryLeakReferenceMatcher should be used to match references in library code that are known to create leaks and are beyond your control. The shortest path finder will only go through matching references after it has exhausted references that don’t match, prioritizing finding an application leak over a known library leak. Library leaks will be reported as LibraryLeak instead of ApplicationLeak.

Constructors

LibraryLeakReferenceMatcher [jvm]
constructor(pattern: ReferencePattern, description: String = "", patternApplies: (HeapGraph) -> Boolean = ALWAYS)

Functions

Name Summary
toString [jvm]
open override fun toString(): String

Properties

Name Summary
description [jvm]
val description: String
A description that conveys what we know about this library leak.
pattern [jvm]
open override val pattern: ReferencePattern
The pattern that references will be matched against.
patternApplies [jvm]
open override val patternApplies: (HeapGraph) -> Boolean
Whether the identified leak may exist in the provided HeapGraph. Defaults to true. If the heap dump comes from a VM that runs a different version of the library that doesn’t have the leak, then this should return false.