Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pyricau committed Dec 25, 2020
1 parent 89d81ce commit 357100d
Show file tree
Hide file tree
Showing 130 changed files with 1,497 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/api/leakcanary-android-core/leakcanary/-no name provided-.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[leakcanary-android-core](../index.md) / [leakcanary](index.md) / [<no name provided>](./-no name provided-.md)

# <no name provided>

`fun <no name provided>(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)

Listener set in [LeakCanary.Config](-leak-canary/-config/index.md) and called by LeakCanary on a background thread when the
heap analysis is complete.

This is a functional interface with which you can create a [OnHeapAnalyzedListener](-on-heap-analyzed-listener/index.md) from a lambda.

Usage:

``` kotlin
val listener = OnHeapAnalyzedListener { heapAnalysis ->
process(heapAnalysis)
}
```

21 changes: 21 additions & 0 deletions docs/api/leakcanary-android-release/alltypes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@


### All Types

| Name | Summary |
|---|---|
| [leakcanary.BackgroundTrigger](../leakcanary/-background-trigger/index.md) | |
| [leakcanary.ConditionalInterceptor](../leakcanary/-conditional-interceptor/index.md) | An interceptor that runs only when [evaluateCondition](#) returns true. |
| [leakcanary.GoodAndroidVersionInterceptor](../leakcanary/-good-android-version-interceptor/index.md) | |
| [leakcanary.HeapAnalysisClient](../leakcanary/-heap-analysis-client/index.md) | |
| [leakcanary.HeapAnalysisConfig](../leakcanary/-heap-analysis-config/index.md) | |
| [leakcanary.HeapAnalysisInterceptor](../leakcanary/-heap-analysis-interceptor/index.md) | |
| [leakcanary.HeapAnalysisJob](../leakcanary/-heap-analysis-job/index.md) | A [HeapAnalysisJob](../leakcanary/-heap-analysis-job/index.md) represents a single prepared request to analyze the heap. It cannot be executed twice. |
| [leakcanary.JobContext](../leakcanary/-job-context/index.md) | In memory store that can be used to store objects in a given [HeapAnalysisJob](../leakcanary/-heap-analysis-job/index.md) instance. This is a simple [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html) of [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) to [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html), but with unsafe generics access. |
| [leakcanary.MinimumDiskSpaceInterceptor](../leakcanary/-minimum-disk-space-interceptor/index.md) | |
| [leakcanary.MinimumElapsedSinceStartInterceptor](../leakcanary/-minimum-elapsed-since-start-interceptor/index.md) | |
| [leakcanary.MinimumMemoryInterceptor](../leakcanary/-minimum-memory-interceptor/index.md) | |
| [leakcanary.OncePerPeriodInterceptor](../leakcanary/-once-per-period-interceptor/index.md) | Proceeds once per [period](#) (of time) and then cancels all follow up jobs until [period](#) has passed. |
| [leakcanary.ProcessInfo](../leakcanary/-process-info/index.md) | |
| [leakcanary.SaveResourceIdsInterceptor](../leakcanary/-save-resource-ids-interceptor/index.md) | Interceptor that saves the names of R.id.* entries and their associated int values to a static field that can then be read from the heap dump. |
| [leakcanary.ScreenOffTrigger](../leakcanary/-screen-off-trigger/index.md) | |
11 changes: 11 additions & 0 deletions docs/api/leakcanary-android-release/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[leakcanary-android-release](./index.md)

### Packages

| Name | Summary |
|---|---|
| [leakcanary](leakcanary/index.md) | |

### Index

[All Types](alltypes/index.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [BackgroundTrigger](index.md) / [&lt;init&gt;](./-init-.md)

# &lt;init&gt;

`BackgroundTrigger(application: Application, analysisClient: `[`HeapAnalysisClient`](../-heap-analysis-client/index.md)`, analysisExecutor: `[`Executor`](https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html)`, processInfo: `[`ProcessInfo`](../-process-info/index.md)` = ProcessInfo.Real, analysisCallback: (`[`HeapAnalysisJob.Result`](../-heap-analysis-job/-result/index.md)`) -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` = { result ->
SharkLog.d { "$result" }
})`
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [BackgroundTrigger](./index.md)

# BackgroundTrigger

`class BackgroundTrigger`

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `BackgroundTrigger(application: Application, analysisClient: `[`HeapAnalysisClient`](../-heap-analysis-client/index.md)`, analysisExecutor: `[`Executor`](https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html)`, processInfo: `[`ProcessInfo`](../-process-info/index.md)` = ProcessInfo.Real, analysisCallback: (`[`HeapAnalysisJob.Result`](../-heap-analysis-job/-result/index.md)`) -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` = { result ->
SharkLog.d { "$result" }
})` |

### Functions

| Name | Summary |
|---|---|
| [start](start.md) | `fun start(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
| [stop](stop.md) | `fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [BackgroundTrigger](index.md) / [start](./start.md)

# start

`fun start(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [BackgroundTrigger](index.md) / [stop](./stop.md)

# stop

`fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [ConditionalInterceptor](index.md) / [&lt;init&gt;](./-init-.md)

# &lt;init&gt;

`ConditionalInterceptor(delegate: `[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)`, evaluateCondition: (`[`HeapAnalysisJob`](../-heap-analysis-job/index.md)`) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)`

An interceptor that runs only when [evaluateCondition](#) returns true.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [ConditionalInterceptor](./index.md)

# ConditionalInterceptor

`class ConditionalInterceptor : `[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)

An interceptor that runs only when [evaluateCondition](#) returns true.

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `ConditionalInterceptor(delegate: `[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)`, evaluateCondition: (`[`HeapAnalysisJob`](../-heap-analysis-job/index.md)`) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)`<br>An interceptor that runs only when [evaluateCondition](#) returns true. |

### Functions

| Name | Summary |
|---|---|
| [intercept](intercept.md) | `fun intercept(chain: `[`HeapAnalysisInterceptor.Chain`](../-heap-analysis-interceptor/-chain/index.md)`): `[`HeapAnalysisJob.Result`](../-heap-analysis-job/-result/index.md) |
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [ConditionalInterceptor](index.md) / [intercept](./intercept.md)

# intercept

`fun intercept(chain: `[`HeapAnalysisInterceptor.Chain`](../-heap-analysis-interceptor/-chain/index.md)`): `[`HeapAnalysisJob.Result`](../-heap-analysis-job/-result/index.md)

Overrides [HeapAnalysisInterceptor.intercept](../-heap-analysis-interceptor/intercept.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [GoodAndroidVersionInterceptor](index.md) / [&lt;init&gt;](./-init-.md)

# &lt;init&gt;

`GoodAndroidVersionInterceptor()`
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [GoodAndroidVersionInterceptor](./index.md)

# GoodAndroidVersionInterceptor

`class GoodAndroidVersionInterceptor : `[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `GoodAndroidVersionInterceptor()` |

### Functions

| Name | Summary |
|---|---|
| [intercept](intercept.md) | `fun intercept(chain: `[`HeapAnalysisInterceptor.Chain`](../-heap-analysis-interceptor/-chain/index.md)`): `[`HeapAnalysisJob.Result`](../-heap-analysis-job/-result/index.md) |
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [GoodAndroidVersionInterceptor](index.md) / [intercept](./intercept.md)

# intercept

`fun intercept(chain: `[`HeapAnalysisInterceptor.Chain`](../-heap-analysis-interceptor/-chain/index.md)`): `[`HeapAnalysisJob.Result`](../-heap-analysis-job/-result/index.md)

Overrides [HeapAnalysisInterceptor.intercept](../-heap-analysis-interceptor/intercept.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisClient](index.md) / [&lt;init&gt;](./-init-.md)

# &lt;init&gt;

`HeapAnalysisClient(heapDumpDirectoryProvider: () -> `[`File`](https://docs.oracle.com/javase/6/docs/api/java/io/File.html)`, config: `[`HeapAnalysisConfig`](../-heap-analysis-config/index.md)`, interceptors: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)`>)`
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisClient](index.md) / [defaultInterceptors](./default-interceptors.md)

# defaultInterceptors

`fun defaultInterceptors(application: Application): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)`>`
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisClient](index.md) / [deleteHeapDumpFiles](./delete-heap-dump-files.md)

# deleteHeapDumpFiles

`fun deleteHeapDumpFiles(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisClient](./index.md)

# HeapAnalysisClient

`class HeapAnalysisClient`

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `HeapAnalysisClient(heapDumpDirectoryProvider: () -> `[`File`](https://docs.oracle.com/javase/6/docs/api/java/io/File.html)`, config: `[`HeapAnalysisConfig`](../-heap-analysis-config/index.md)`, interceptors: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)`>)` |

### Functions

| Name | Summary |
|---|---|
| [deleteHeapDumpFiles](delete-heap-dump-files.md) | `fun deleteHeapDumpFiles(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
| [newJob](new-job.md) | `fun newJob(context: `[`JobContext`](../-job-context/index.md)` = JobContext()): `[`HeapAnalysisJob`](../-heap-analysis-job/index.md) |

### Companion Object Functions

| Name | Summary |
|---|---|
| [defaultInterceptors](default-interceptors.md) | `fun defaultInterceptors(application: Application): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`HeapAnalysisInterceptor`](../-heap-analysis-interceptor/index.md)`>` |
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisClient](index.md) / [newJob](./new-job.md)

# newJob

`fun newJob(context: `[`JobContext`](../-job-context/index.md)` = JobContext()): `[`HeapAnalysisJob`](../-heap-analysis-job/index.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](index.md) / [&lt;init&gt;](./-init-.md)

# &lt;init&gt;

`HeapAnalysisConfig(referenceMatchers: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<ReferenceMatcher> = AndroidReferenceMatchers.appDefaults, objectInspectors: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<ObjectInspector> = AndroidObjectInspectors.appDefaults, metadataExtractor: MetadataExtractor = AndroidMetadataExtractor, computeRetainedHeapSize: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true, leakingObjectFinder: LeakingObjectFinder = FilteringLeakingObjectFinder(
AndroidObjectInspectors.appLeakingObjectFilters
), stripHeapDump: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false)`
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](index.md) / [computeRetainedHeapSize](./compute-retained-heap-size.md)

# computeRetainedHeapSize

`val computeRetainedHeapSize: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)

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).

Computing the retained heap size can slow down the analysis because it requires navigating
from GC roots through the entire object graph, whereas [shark.HeapAnalyzer](#) would otherwise
stop as soon as all leaking instances are found.

Defaults to true.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](./index.md)

# HeapAnalysisConfig

`data class HeapAnalysisConfig`

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `HeapAnalysisConfig(referenceMatchers: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<ReferenceMatcher> = AndroidReferenceMatchers.appDefaults, objectInspectors: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<ObjectInspector> = AndroidObjectInspectors.appDefaults, metadataExtractor: MetadataExtractor = AndroidMetadataExtractor, computeRetainedHeapSize: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true, leakingObjectFinder: LeakingObjectFinder = FilteringLeakingObjectFinder(
AndroidObjectInspectors.appLeakingObjectFilters
), stripHeapDump: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false)` |

### Properties

| Name | Summary |
|---|---|
| [computeRetainedHeapSize](compute-retained-heap-size.md) | `val computeRetainedHeapSize: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>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](leaking-object-finder.md) | `val leakingObjectFinder: LeakingObjectFinder`<br>Finds the objects that are leaking, for which LeakCanary will compute leak traces. |
| [metadataExtractor](metadata-extractor.md) | `val metadataExtractor: MetadataExtractor`<br>Extracts metadata from a hprof to be reported in [shark.HeapAnalysisSuccess.metadata](#). Called on a background thread during heap analysis. |
| [objectInspectors](object-inspectors.md) | `val objectInspectors: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<ObjectInspector>`<br>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](reference-matchers.md) | `val referenceMatchers: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<ReferenceMatcher>`<br>Known patterns of references in the heap, added here either to ignore them ([IgnoredReferenceMatcher](#)) or to mark them as library leaks ([LibraryLeakReferenceMatcher](#)). |
| [stripHeapDump](strip-heap-dump.md) | `val stripHeapDump: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>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. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](index.md) / [leakingObjectFinder](./leaking-object-finder.md)

# leakingObjectFinder

`val leakingObjectFinder: LeakingObjectFinder`

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

Defaults to a [FilteringLeakingObjectFinder](#) that scans all objects in the heap dump and
delegates the decision to [AndroidObjectInspectors.appLeakingObjectFilters](#).

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](index.md) / [metadataExtractor](./metadata-extractor.md)

# metadataExtractor

`val metadataExtractor: MetadataExtractor`

Extracts metadata from a hprof to be reported in [shark.HeapAnalysisSuccess.metadata](#).
Called on a background thread during heap analysis.

Defaults to [AndroidMetadataExtractor](#)

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](index.md) / [objectInspectors](./object-inspectors.md)

# objectInspectors

`val objectInspectors: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<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.

Defaults to [AndroidObjectInspectors.appDefaults](#)

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](index.md) / [referenceMatchers](./reference-matchers.md)

# referenceMatchers

`val referenceMatchers: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<ReferenceMatcher>`

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

When adding your own custom [LibraryLeakReferenceMatcher](#) instances, you'll most
likely want to set [LibraryLeakReferenceMatcher.patternApplies](#) with a filter that checks
for the Android OS version and manufacturer. The build information can be obtained by calling
[shark.AndroidBuildMirror.fromHeapGraph](#).

Defaults to [AndroidReferenceMatchers.appDefaults](#)

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[leakcanary-android-release](../../index.md) / [leakcanary](../index.md) / [HeapAnalysisConfig](index.md) / [stripHeapDump](./strip-heap-dump.md)

# stripHeapDump

`val stripHeapDump: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)

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.

Loading

0 comments on commit 357100d

Please sign in to comment.