mrkeyoor.com_
Fri 16 Oct 18:52 UTC
Dev Toolsevaluationupdated 13 Oct 2026

leakcanary review

LeakCanary detects memory leaks in Android apps and shows the references that keep unwanted objects alive. It helps developers investigate screens and other objects that remain in memory after their useful lifetime has ended.

+2 / 2dstars / 7d
Verdict

Our LeakCanary source build and tests each failed after 1 second because Gradle could not obtain Java 17 in the Java 21 sandbox. I would still trial its published debug dependency for Android lifecycle leaks, while treating source-checkout readiness as unresolved. Choose another tool for native allocation analysis or budget a custom integration for production reporting.

We ran it

Lab card: what happened when we ran leakcanaryScreenshot of leakcanary (square.github.io/leakcanary)
Install✓ · 7s
Build✗ · 1s
Tests✗ · 1sran, no count parsed
Repo1077 files~113,624 lines of source · 218.1 MB · 5 CI workflows

Answers from our run

Does leakcanary build from source?

Dependencies installed in 7 seconds, and the build failed. We cloned commit 6fb67c4 into a clean Debian container with 3 CPUs and no project-specific setup.

Do leakcanary's tests pass?

The test command failed in our container, and its output did not report a pass or fail count.

Who should not use leakcanary?

Teams expecting ready-made production monitoring: the standard artifact is intended for debug builds, and the release guide calls the production APIs experimental and requires a custom integration.

What are the alternatives to leakcanary?

Android Studio memory tools, Tencent Matrix. Our LeakCanary source build and tests each failed after 1 second because Gradle could not obtain Java 17 in the Java 21 sandbox.

Setup3/5Debug integration is direct; our source run lacked Java 17
Docs4/5Clear traces and release guidance, with different release lines
Community5/5October push and active work on retained-object detection
Maturity4/5Established Android workflow; latest tag is an alpha

Discussed on

  1. hnLeakCanary, an Android library from Square to help find memory leaks21 points
  2. hn3,000 GitHub stars in 10 days – respect5 points
  3. hnLeak-Canary: A memory leak detection library for Android and Java3 points

Who it’s for

Android developers investigating activities, fragments, or ViewModels that remain in memory after their lifecycle ends.
Teams wanting automatic debug-build reports with reference paths they can inspect against application code.
Developers prepared to interpret framework leaks separately from references their own code can remove.

Who it’s NOT for

Teams expecting ready-made production monitoring: the standard artifact is intended for debug builds, and the release guide calls the production APIs experimental and requires a custom integration.
Developers investigating only native allocation growth: the documented LeakCanary workflow captures and analyzes the Java heap.
Contributors expecting Java 21 alone to build this checkout: our build and test logs both stopped because the required Java 17 toolchain could not be provisioned.
Teams whose policy prohibits alpha releases but blindly follow GitHub's latest tag: the latest release is v3.0-alpha-9, while the quick-start page names the stable dependency line.

Setup reality

Our sandbox installed commit 6fb67c4 in 7 seconds. Build and tests each failed with exit code 1 after 1 second. Both logs say Gradle could not obtain the required Java 17 toolchain because no toolchain download repository was defined. The logs don't show a detector defect or a failed Android assertion.

Using the library follows a separate route: add the documented Android dependency under debugImplementation and confirm startup in Logcat. Basic local detection needs an Android development environment and an app to exercise, without a hosted service credential. Custom release reporting uses experimental APIs and requires additional integration.

We used a fresh Debian lab-jvm:21 container with 3 CPUs, 10 GB of RAM, no secrets, and no privileges. Source contributors must provide the requested JDK or configure provisioning before retrying. Heap capture can briefly freeze the app. Our source run supplies no device-overhead or detection-accuracy measurement.

LeakCanary points to references that keep Android objects alive

A screen can disappear while its activity remains in memory. LeakCanary watches objects that should become collectible and analyzes a heap dump when retention deserves investigation. The result is a reference path you can follow toward the code holding an object alive. Its README describes an Android memory-leak library, and the practical appeal is receiving a diagnosis while exercising the app instead of waiting for a memory-related crash.

Our source-checkout build failed in 1 second because Gradle could not obtain the required Java 17 toolchain. The test command failed on the same requirement. That result matters if you want to modify LeakCanary itself. It doesn't establish whether its published Android dependency works in your app, which follows a different adoption path. I would try the debug dependency before committing to work on the upstream checkout.

The starter dependency belongs in your debug variant

The getting-started guide puts leakcanary-android under debugImplementation and says ordinary integration needs no application code change. You confirm startup through the LeakCanary tag in Logcat. Automatic watching covers destroyed activities and fragments, including fragment views, and cleared ViewModels. That makes it useful for teams investigating lifecycle mistakes during normal development, without requiring a developer to start every investigation manually.

Cloning the whole project means a different scale of work: our checkout contained 1,077 files, roughly 113,624 source lines, and occupied 218.1 MB. Those figures describe the source repository, not the size added to an Android application. The quick-start page still names the stable dependency while GitHub's latest release is an alpha. Choose your intended release line explicitly rather than treating the latest tag as an automatic upgrade recommendation.

What happened when we ran it

Our sandbox installed LeakCanary commit 6fb67c4 in 7 seconds, then the build and tests each failed with exit code 1 after 1 second. We ran it on October 12, 2026, in a fresh Debian container with 3 CPUs, 10 GB of RAM, and the lab-jvm:21 image. The container had no secrets and ran without elevated privileges. The successful install step didn't produce a successful source build.

Both logs say Gradle was unable to download a toolchain matching Java 17 because no toolchain download repository was defined. The build log also records JAVA_TOOL_OPTIONS with a 6 GB maximum heap. The reported failure concerns finding the required Java toolchain. It doesn't report an out-of-memory condition, an Android assertion failure, or a defective leak detector. A newer JVM in the container doesn't satisfy a separately requested toolchain automatically.

The scan recorded 5 CI workflow files, no Dockerfile, and no tests directory. Those detection results don't mean the repository lacks checks: our test command started and stopped on toolchain resolution. For source development, make the requested JDK available or configure provisioning, then rerun the commands. Our measurement stops at the failure, so we can't claim that either remedy would produce a green build or suite.

Heap dumps interrupt the app and still require interpretation

The fundamentals describe weak-reference watching, heap capture, and analysis through Shark. A leak trace follows references that prevent collection. Similar traces are grouped, and known framework or library leaks are separated from application leaks. That distinction saves you from assuming every retained activity proves a mistake in your own code. You still need to inspect the path and decide which reference should stop existing.

None of our 7-second installation result measures that diagnostic workflow. Heap capture briefly freezes the application according to the docs, which is a real interruption when reproducing a flow. Keep a note of the navigation or lifecycle action that triggered the report, then inspect the suspect reference against the relevant source. An activity held through a view's context calls for a different repair than an intentionally resident application object.

Default debugging behavior doesn't provide production monitoring

The release guide calls its production APIs experimental, with artifact names and APIs subject to change. It provides a dedicated release artifact and an optional object watcher, followed by application code for triggers and uploading analysis to Bugsnag. You'll decide when capture runs and how reports reach your service. That is additional work for a team looking for a ready-made production reporting service.

Our run used 10 GB of RAM on a Debian host, not an Android device, and supplies no device-overhead measurement. Don't transfer that memory allowance into a claim about phone requirements. LeakCanary's documented workflow examines the Java heap. If your problem is native allocation growth or a broad performance investigation, Android Studio's memory tools are the better starting point. Tencent Matrix is worth comparing when you also need Android performance plugins.

October fixes show maintenance beyond the June alpha release

GitHub records an October 12, 2026 push, 30,002 stars, and 135 open issues and PRs. The latest release is v3.0-alpha-9, published June 25. An October reference-queue proposal addresses retained-object counts that can trigger heap dumps whose analysis finds no leak. That work concerns the detector directly, rather than an unrelated component, and remains an open proposal.

The active work earns LeakCanary a place in an Android debug trial, while our 1-second source failures prevent a claim that this checkout is ready on a plain Java 21 container. Start with the documented dependency and reproduce a lifecycle flow you care about. Then use the trace to remove an unwanted reference and repeat the flow. The useful result is an explained and corrected retention path, which our sandbox did not measure.

Alternatives

ProjectWhat it isPick it when
Android Studio memory toolsIDE tools for heap snapshots and allocation investigations.pick this instead when you want an interactive memory investigation, including work beyond lifecycle leak reports.
Tencent MatrixAn application performance toolkit with Android resource-leak and tracing plugins.pick this instead when leak detection belongs alongside a broader Android performance-monitoring effort.

What people are saying

  1. [velocity-scout] square/leakcanary

Sources

  1. LeakCanary README
  2. Debug dependency setup
  3. Heap capture and leak traces
  4. Production integration requirements
  5. Latest alpha release
  6. Reference queue detection proposal
  7. GitHub repository facts
  8. Android Studio native allocation recording

More dev tools reviews

compose-samples · librepods · sqlmap · coucou · world-execute-me-dsh-pv · mcp-extensions · the whole board →