leakcanary README

The project's README from github.com/square/leakcanary. As one markdown file: README.md.

LeakCanary ๐Ÿค

A memory leak detection library for Android.

square.github.io/leakcanary

๐Ÿ™ If you like LeakCanary you can show support by starring โญ this repository.

License

Copyright 2015 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

leakcanary (square/leakcanary)

Searching Databaseโ€ฆ

30K ยทGitHub
What is this?LeakCanary is a memory leak detection library for Android apps, built by Square.
Is this a library I add to my app, or a standalone tool?It is a library you integrate into your Android project as a debug dependency; it runs inside your app during development to watch for leaked objects, not a separate app or service.
How do I add it to my Android project?Add LeakCanary as a debugImplementation dependency in your app's build.gradle so it only ships in debug builds, then run the app normally; it automatically starts watching for leaks.
Do I need a special environment to use it?You just need an Android project written in Java or Kotlin; LeakCanary itself is written in Kotlin and targets Android apps.
Will it slow down my release builds?No, it is meant to be added as a debug-only dependency so it is stripped out of release builds and does not affect production performance.
How does LeakCanary actually detect a leak?It watches objects that should be garbage collected (like destroyed Activities or Fragments) and, if they are not collected after a delay, dumps and analyzes the heap to find the retention path causing the leak.
What is the shark heap analyzer mentioned in the project's CI?Shark is the heap-analysis library LeakCanary uses internally to parse heap dumps and compute leak traces, and the repo has dedicated workflows for releasing it.
Why would I use LeakCanary instead of manually taking heap dumps in Android Studio?LeakCanary automates the whole process in-app, surfacing leak traces with a readable stack-trace-like report as soon as they happen, instead of requiring you to manually capture and inspect .hprof files.
What are similar projects?memray, logger, timber, butterknife, MPAndroidChart, Luban, fresco, DoKit
Creator
square
Size
154.9 MB
Stars
30K
Age
11y
Commits ยท 90 Days