
HeapLens (v1.0.21, Apache 2.0) is the only VS Code extension for .hprof heap dump analysis — a native Rust engine parses a 1.5 GB dump in ~0.9 s. Open a dump, trace GC roots via Dominator Tree, and query with HeapQL or AI Chat without ever leaving your editor.
jmap, open Eclipse MAT or VisualVM, wait for parsing, hunt for the culprit, cross-reference back in your editor. Sachin Gupta, author of HeapLens, puts it plainly: "Heap dump analysis is one of those tasks that usually pulls you out of your editor." 1.hprof analysis 1 — that opens Java and Android heap dumps directly in the editor. It ships a bundled native Rust engine, so there's nothing to install beyond the extension itself..hprof file in VS Code activates HeapLens as a custom editor. The Rust parser runs immediately, and you get 10 interactive tabs covering the full analysis workflow: 2.java files, Maven/Gradle source JARs, or CFR decompiler fallbackmmap parsing with a two-phase CSR (Compressed Sparse Row) graph, the Lengauer-Tarjan dominator-tree algorithm, and rayon-parallelized edge extraction. 3 Benchmarks on Apple M1 (median of 5 runs): 3| Heap dump size | Parse time | Throughput |
|---|---|---|
| 1.5 GB | ~0.9 s | 1,687 MB/s |
| 2 GB | ~1.2 s | 1,645 MB/s |
| 14 GB | ~10.5 s | 1,365 MB/s |
jmap -dump:format=b,file=heap.hprof <pid>OutOfMemoryError, add these JVM flags instead:-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./heap.hprofadb shell am dumpheap <pid> /data/local/tmp/heap.hprof.hprof file into your VS Code workspace and double-click it. HeapLens activates automatically. The Overview tab shows total heap size, reachable heap, and a Quick Checks panel that surfaces CRITICAL-level alerts if any class is retaining an abnormal share of memory.byte[] holds 14.22 GB (83.29% of reachable), and ConnectionPool$SimulatedConnection holds 10 GB (58.60%). 2ByteArrayOutputStream instance retaining 1.00 GB, the path resolves to: 2SuperRoot → ConnectionPool$SimulatedConnection → ByteArrayOutputStreaminstances, class_histogram, dominator_tree, leak_suspects) and supports SELECT, WHERE, GROUP BY, ORDER BY, JOIN, subqueries, and aggregate functions. Size literals like 1MB and 1GB work directly — no manual byte conversion. 3HashMap instances:SELECT * FROM instances
WHERE class_name = 'java.util.HashMap'
AND retained_size > 1MB
ORDER BY retained_size DESCSELECT class_name,
COUNT(*) AS instance_count,
SUM(retained_size) AS total_retained
FROM class_histogram
GROUP BY class_name
ORDER BY total_retained DESC
LIMIT 10SELECT * FROM instances
WHERE class_name LIKE '%ConnectionPool%'
ORDER BY retained_size DESC@heaplens /leaks command runs leak detection directly from the Copilot panel. And for teams using Claude Desktop, Cline, or other MCP-compatible AI clients, HeapLens ships an MCP server: hprof-server --mcp. 2ext install guptasachinn.heaplensCtrl+Shift+X / Cmd+Shift+X). Minimum VS Code version: 1.109.0. No additional dependencies — the Rust binary is bundled. Also available on Open VSX for VSCodium and compatible forks.~/.m2) or Gradle (~/.gradle) cache; CFR decompilation fallback requires Java on PATHguptasachinn.heaplensmarketplace.visualstudio.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.