Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/leakcanary/LeakCanary/Config/Builder

Builder

[androidJvm]\ class Builder

Builder for LeakCanary.Config intended to be used only from Java code.

Usage:

LeakCanary.Config config = LeakCanary.getConfig().newBuilder()
   .retainedVisibleThreshold(3)
   .build();
LeakCanary.setConfig(config);

For idiomatic Kotlin use copy() method instead:

LeakCanary.config = LeakCanary.config.copy(retainedVisibleThreshold = 3)

Functions

Name Summary
build [androidJvm]
fun build(): LeakCanary.Config
computeRetainedHeapSize [androidJvm]
fun computeRetainedHeapSize(computeRetainedHeapSize: Boolean): LeakCanary.Config.Builder
dumpHeap [androidJvm]
fun dumpHeap(dumpHeap: Boolean): LeakCanary.Config.Builder
dumpHeapWhenDebugging [androidJvm]
fun dumpHeapWhenDebugging(dumpHeapWhenDebugging: Boolean): LeakCanary.Config.Builder
eventListeners [androidJvm]
fun eventListeners(eventListeners: List<EventListener>): LeakCanary.Config.Builder
heapDumper [androidJvm]
fun heapDumper(heapDumper: HeapDumper): LeakCanary.Config.Builder
leakingObjectFinder [androidJvm]
fun leakingObjectFinder(leakingObjectFinder: LeakingObjectFinder): LeakCanary.Config.Builder
maxStoredHeapDumps [androidJvm]
fun maxStoredHeapDumps(maxStoredHeapDumps: Int): LeakCanary.Config.Builder
metadataExtractor [androidJvm]
fun metadataExtractor(metadataExtractor: MetadataExtractor): LeakCanary.Config.Builder
objectInspectors [androidJvm]
fun objectInspectors(objectInspectors: List<ObjectInspector>): LeakCanary.Config.Builder
referenceMatchers [androidJvm]
fun referenceMatchers(referenceMatchers: List<ReferenceMatcher>): LeakCanary.Config.Builder
requestWriteExternalStoragePermission [androidJvm]
fun requestWriteExternalStoragePermission(requestWriteExternalStoragePermission: Boolean): LeakCanary.Config.Builder
retainedVisibleThreshold [androidJvm]
fun retainedVisibleThreshold(retainedVisibleThreshold: Int): LeakCanary.Config.Builder
showNotifications [androidJvm]
fun showNotifications(showNotifications: Boolean): LeakCanary.Config.Builder