LeakLens is a high-performance, professional-grade memory leak detection and fix assistant for Android Studio. It bridges the gap between static code analysis and runtime heap debugging, providing a seamless "detect-analyze-fix" workflow without ever leaving your IDE.
Most tools wait for your app to crash. LeakLens catches leaks before they are even compiled.
Using a high-performance UAST (Universal Abstract Syntax Tree) engine, LeakLens scans your Kotlin and Java code in real-time.
- Write-Time Prevention: 6+ specialized inspections flag leaks (like static Activity references or uncancelled coroutines) as you type.
- Editor Gutter Icons: Visual markers (π«,
β οΈ ) indicate leaking classes directly in the code gutter. - One-Click Fixes: Use
Alt + Enterto automatically apply industry-standard patterns likeWeakReferencewrapping or lifecycle cleanup.
Integrates the Shark Heap Analysis engine (used by LeakCanary) directly into the IDE.
- SDK-Free Capture: No need to add dependencies to your
build.gradle. LeakLens works entirely via ADB and host-side analysis. - Live Memory Graph: Monitor Java Heap, Native Heap, and PSS in real-time with an integrated lite profiler.
- Auto-Trigger Safeguards: Configure thresholds to automatically dump the heap when your app hits critical memory levels.
Stop guessing. Discuss complex leak traces with Android Studioβs built-in AI.
-
Context-Aware Prompts: One click generates a professional Markdown analysis request for Gemini.
-
Actionable Solutions: Get code-specific fix suggestions for complex library or framework leaks.
| Feature | LeakLens | Android Studio Profiler | LeakCanary |
|---|---|---|---|
| IDE Integrated | β Full | β Partial | β External App |
| AI Fix Assistant | β Yes (Gemini/GPT) | β No | β No |
| Zero Code Changes | β Yes (ADB based) | β Yes | β Requires SDK |
| Static Analysis | β Real-time (UAST) | β No | β No |
| One-Click Fixes | β Yes | β No | β No |
| Feature | Technical Detail |
|---|---|
| Universal Support | Native support for Java, Kotlin, and Jetpack Compose. |
| Precision Navigation | Click any class in a leak trace to jump to the exact line of code. |
| VCS Baselines | Commit leak-baseline.json to suppress legacy leaks and focus on new regressions. |
| CI/CD Ready | Export professional reports in HTML, JSON, or SARIF formats. |
| Deobfuscation | Automatic R8/ProGuard mapping resolution for production heap dumps. |
- Marketplace: Search for
LeakLensin Settings β Plugins β Marketplace. - Plugin Window: Open the LeakLens tab at the bottom of Android Studio.
- ADB Ready: Connect your device/emulator and click the Dump Heap icon to begin.
We welcome contributions from the Android community! Please see our Contributing Guide to get started with the IntelliJ Platform SDK.
LeakLens is open-source software licensed under the Apache License, Version 2.0.
Built with β€οΈ by Vikas Soni