HeapLens

A VS Code extension for Java and Android heap-dump analysis: a native Rust engine, 11 interactive views, a SQL-like query language, and an AI assistant, all running locally on production-sized dumps.
HeapLens brings Java and Android heap-dump analysis into VS Code. Open any
.hprof file and explore memory usage through 11 interactive views:
dominator trees, class histograms, leak suspects, waste detection, snapshot
comparison, and more. No separate tools, no context switching, and nothing
uploaded to the cloud. Heap file contents never leave the machine.
A native Rust engine
The analysis runs on a native Rust engine built for production-sized dumps: zero-copy mmap parsing, a two-phase CSR architecture, a Lengauer-Tarjan dominator tree, and rayon-parallelized edge extraction. The Rust core talks to the TypeScript extension over JSON-RPC, and the same binary doubles as an MCP server so AI clients can drive heap analysis directly.
HeapQL
HeapLens introduces HeapQL, a SQL-like query language purpose-built for heap
analysis. Query any object, filter by retained size, join across tables
(instances, class_histogram, dominator_tree, leak_suspects), run
aggregates and subqueries, and export results, all without leaving the editor.
Size literals like 1MB and GC-root path lookups are first-class.
AI-powered analysis
A built-in assistant explains findings in plain English and suggests code-level fixes. Ask "why is my app using 2 GB of memory?" and get an answer plus a runnable HeapQL query you can execute inline. It supports 10 LLM providers, including local models through Ollama, so the AI features can run with no data leaving the machine either.
Source bridge and waste detection
A three-tier source resolver jumps from a heap object to the actual Java source: workspace files first, then Maven/Gradle dependency JARs, falling back to CFR decompilation. Waste detection automatically surfaces duplicate strings, empty and over-allocated collections, and boxed primitives.
HeapLens is published on the VS Code Marketplace under Apache 2.0, with a citable release archived on Zenodo.
