HeapAnalysisConfig

data class HeapAnalysisConfig(referenceMatchers: List<ReferenceMatcher>, objectInspectors: List<ObjectInspector>, metadataExtractor: MetadataExtractor, computeRetainedHeapSize: Boolean, leakingObjectFinder: LeakingObjectFinder, stripHeapDump: Boolean)

Properties

computeRetainedHeapSize
Link copied to clipboard
val computeRetainedHeapSize: Boolean = true

Whether to compute the retained heap size, which is the total number of bytes in memory that would be reclaimed if the detected leaks didn't happen. This includes native memory associated to Java objects (e.g. Android bitmaps).

leakingObjectFinder
Link copied to clipboard
val leakingObjectFinder: LeakingObjectFinder

Finds the objects that are leaking, for which LeakCanary will compute leak traces.

metadataExtractor
Link copied to clipboard
val metadataExtractor: MetadataExtractor

Extracts metadata from a hprof to be reported in shark.HeapAnalysisSuccess.metadata. Called on a background thread during heap analysis.

objectInspectors
Link copied to clipboard
val objectInspectors: List<ObjectInspector>

List of ObjectInspector that provide LeakCanary with insights about objects found in the heap. You can create your own ObjectInspector implementations, and also add a shark.AppSingletonInspector instance created with the list of internal singletons.

referenceMatchers
Link copied to clipboard
val referenceMatchers: List<ReferenceMatcher>

Known patterns of references in the heap, added here either to ignore them (IgnoredReferenceMatcher) or to mark them as library leaks (LibraryLeakReferenceMatcher).

stripHeapDump
Link copied to clipboard
val stripHeapDump: Boolean = false

Whether the first step after a heap dump should be to replace the content of all arrays with zeroes. This increases the overall processing time but limits the amount of time the heap dump exists on disk with potential PII.