Skip to content

dev-vikas-soni/leak-lens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,121 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LeakLens - Memory Leak Detector & AI Assistant πŸ§ πŸ’§

JetBrains Marketplace Version Build Status License

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.

latets-leallense-dashboard

πŸ“Ί Watch LeakLens in Action


πŸš€ The LeakLens Advantage

Most tools wait for your app to crash. LeakLens catches leaks before they are even compiled.

1. Static Analysis Layer (SonarLint-Style)

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 + Enter to automatically apply industry-standard patterns like WeakReference wrapping or lifecycle cleanup.
static-analysis-leaklens

2. Runtime Precision (Shark-Powered)

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.
leaklens-memory-graph

3. AI Fix Assistant (Gemini Integrated)

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.

    ask_ai-leaklens

πŸ“Š Why LeakLens? (Comparison)

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

✨ Key Features

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.

πŸ› οΈ Installation

  1. Marketplace: Search for LeakLens in Settings β†’ Plugins β†’ Marketplace.
  2. Plugin Window: Open the LeakLens tab at the bottom of Android Studio.
  3. ADB Ready: Connect your device/emulator and click the Dump Heap icon to begin.
plugin-setting-leallens

🀝 Contributing

We welcome contributions from the Android community! Please see our Contributing Guide to get started with the IntelliJ Platform SDK.


βš–οΈ License

LeakLens is open-source software licensed under the Apache License, Version 2.0.


Built with ❀️ by Vikas Soni

Releases

No releases published

Packages

 
 
 

Contributors