A memory leak detection library for Android.
29.9k
Stars
4k
Forks
138
Open issues
30
Contributors
AI Analysis
LeakCanary is a memory leak detection library for Android that identifies and traces memory leaks during development and testing. It serves developers building Android applications who need to diagnose memory-related performance issues before they reach production. While the project has substantial adoption (nearly 30k stars), it is specialized for Android memory debugging and is not a general-purpose tool—it benefits Android engineers specifically, not broader software development audiences.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
LeakCanary: Square's mature Android memory leak detector with ~30k stars and a decade of production use
LeakCanary is an automatic memory leak detection library for Android apps, built by Square and open-sourced in 2015. It instruments app lifecycle events, captures heap dumps when objects are suspected of leaking, and produces human-readable leak traces without requiring developers to manually trigger profiling. Its primary audience is Android app developers who want to catch memory leaks during development and CI without deep JVM/native profiling expertise. It has become a de facto standard tool in the Android development ecosystem.
Released by Square in April 2015, LeakCanary filled a critical gap in Android tooling where memory leak diagnosis required manual heap dump analysis. It has gone through two major API revisions (v1 Java, v2 Kotlin rewrite), steadily improving automation and accuracy.
Growth was driven by Square's credibility, the absence of comparable automated tooling, and strong community adoption across Android teams of all sizes. The v2 rewrite in Kotlin broadened appeal and modernized the API. Star velocity has slowed to near-zero (10 stars/week) as the library has matured and reached near-saturation in its target market, not due to decline.
LeakCanary is one of the most widely referenced Android libraries in developer documentation, blog posts, and conference talks over the past decade. It appears in Google's own Android performance guidance and is integrated into major apps across industries. Adoption at scale is well-documented in public engineering blogs from companies such as Square itself, and is referenced extensively in Android development courses and books.
Likely built around Android lifecycle hooks (ActivityLifecycleCallbacks, WeakReference monitoring) combined with an in-process heap dump trigger and an off-process heap analysis engine (Shark, Square's own heap parser). The v2 rewrite appears to separate the watcher, heap dump, and analysis phases into distinct modules.
Not documented in README
Last push was March 24, 2026 — approximately 3 months before the evaluation date. Given the library's maturity, this cadence (periodic rather than frequent pushes) is consistent with a stable, actively maintained project rather than abandonment. The project appears to still receive attention from Square engineers.
ADOPT IF: you are building or maintaining an Android app and want automated, zero-configuration memory leak detection during development or CI — this is the mature, community-validated tool for that exact job. AVOID IF: you need production/runtime leak detection in a live user environment, or if your concern is native (NDK) memory leaks, which LeakCanary does not cover. MONITOR IF: Google significantly enhances Android Studio's automated leak detection to match LeakCanary's automation level, which could reduce the need for a separate library.
Independent dimensions
Mainstream potential
4/10
Technical importance
9/10
Adoption evidence
9/10
- Android platform changes (ART runtime, process isolation model) could break heap dump or watchdog mechanisms, requiring reactive maintenance from Square.
- Square's internal prioritization could reduce maintenance bandwidth if Android is deprioritized internally, though the open-source community could absorb this.
- The library is primarily a development-time tool; its value in CI pipelines depends on having reliable UI test coverage — teams without this see limited automated benefit.
- Native (NDK/C++) memory leaks are outside the library's scope, leaving a gap for apps with significant native code.
- Near-zero new star growth suggests the library has reached adoption saturation in its niche; it is unlikely to expand significantly beyond the Android developer audience.
LeakCanary will remain the default Android memory leak detection library for the foreseeable future, evolving incrementally with Android API changes rather than expanding its scope. Slow growth is expected as the Android developer market itself matures.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- Kotlin
- License
- Apache-2.0
- Last updated
- 2w ago
- Created
- 136mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Top contributors
Similar repos
measure-sh/measure
Measure is an open-source mobile application monitoring platform that captures...
bugsnag/bugsnag-android
BugSnag Android is a crash monitoring and error reporting SDK for Android...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
29.9k | +4 | Kotlin | 8/10 | 2w ago |
|
|
4.1k | — | C++ | 8/10 | 10h ago |
|
|
1.3k | — | TypeScript | 7/10 | 18h ago |
|
|
1.2k | — | Kotlin | 8/10 | 1w ago |
|
|
6.1k | — | Python | 7/10 | 11mo ago |
|
|
7k | — | Kotlin | 8/10 | 1w ago |
Google's built-in tool provides rich heap and allocation profiling but requires manual invocation and does not automate leak detection during app use. LeakCanary is complementary — automating detection while the profiler handles deeper investigation.
A native C++ heap profiler for Linux desktop/server workloads. Not applicable to Android Java/Kotlin heap leak scenarios; serves an entirely different platform and use case.
Python memory profiler. Solves an analogous problem (memory leak tracing) in Python rather than Android/JVM. No overlap in deployment target.
JavaScript/browser memory leak detection via heap snapshot diffing. Targets web frontend developers, not Android developers. Conceptually similar approach but different ecosystem.
These are sub-modules within LeakCanary itself (Shark, Plumber), not third-party competitors. No meaningful external competitor in the automated Android JVM memory leak detection space exists at comparable maturity.