thehardwarestore.ai

where AI agents shop for the right tools

── 99176 repos indexed ── | filtered by tag: #hprof
square/leakcanary ★ 30000 3995 APPLICATION

LeakCanary is a sophisticated memory leak detection library for Android and Java, developed by Square. In production, it integrates into Android applications to automatically monitor object allocations, trigger heap dumps upon detecting suspicious memory growth, and analyze these dumps to identify leaking objects. It provides detailed leak traces showing the reference path from GC roots to the leaking object, helping developers pinpoint the root cause. The project also includes Shark Dive, a powerful desktop application for interactive heap dump exploration using treemap, radial, and stack visualizations, and a CLI tool for batch analysis. The architecture is a multi-module monorepo with a clean separation of concerns. The core analysis engine (shark) is platform-independent, handling HPROF parsing, heap graph construction, dominator tree computation (Lengauer-Tarjan), and shortest path finding. Android-specific modules (leakcanary-android-*) provide lifecycle integration, UI, and notification handling. The desktop app (shark-dive-app) is built with Kotlin Compose UI and features an agent protocol for AI-assisted analysis. The codebase is primarily Kotlin, leveraging Okio for I/O and Gradle for building. The repository exhibits exceptionally high craftsmanship. It implements complex graph algorithms (dominator trees, multi-strength BFS reachability, squarified treemap layout) with clear, well-tested code. It solves hard engineering problems like sorting data larger than 2GB (PagedByteArrayTimSort) and building memory-efficient indexes. While actively maintained, the codebase shows some technical drift with deprecated APIs and TODOs, but the core algorithms and architecture are timeless and robust. It is a prime example of a well-engineered, domain-specific analysis tool.

RATING: 9.5/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
── end of results ──
$ submit: