What is it about?
A Java application can run out of memory even when the objects taking up space are no longer useful. For example, a cache might keep an expired session reachable. Finding that session is only the start: a developer still needs to understand what holds it in memory and whether its lifetime is intentional. HeapLens is an open-source tool for Java heap dump analysis inside Visual Studio Code (VS Code) and compatible editors. A heap dump is a snapshot of objects and their recorded references. HeapLens reads this snapshot locally and lets developers explore it alongside their source code. A class histogram shows object counts and sizes by class. A dominator tree summarizes which objects must be passed through on retaining paths to other objects. Reference inspection and paths from garbage-collection roots help explain why an object remains reachable. Roots are the starting points from which the runtime keeps objects alive. Developers can query the snapshot with HeapQL, the tool's SQL-style query language, compare captures, and navigate from an eligible class to available Java source. An optional artificial intelligence (AI) assistant can help explain selected findings; model explanations still require checking against the heap evidence.
Featured Image
Photo by Mohammad Rahmani on Unsplash
Why is it important?
Java memory leak debugging involves more than finding the largest class. A small cache or registry can keep a much larger group of objects reachable. A large retained set may also be expected, so size alone does not establish a leak. HeapLens connects heap exploration, targeted queries and source navigation in the editor where developers investigate their application. Its Rust engine builds the object-reference graph and computes the ownership information used by the views. This makes it possible to move from a memory finding to relevant code without manually searching for every class name. The SPLASH 2026 tool paper describes the integrated workflow and reports analysis measurements on heap dumps up to 14.8 GB. Those measurements apply to the evaluated implementation and workloads; a new dump's processing time and memory needs depend on its structure and the machine running the analysis. Heap analysis does not require an AI service or uploading the dump. Optional AI features have a separate sharing boundary: selected context can go to the configured model service. Source lookup also depends on which code is available.
Perspectives
I built HeapLens to bring memory investigation closer to everyday development. The question I want it to help answer is straightforward: what is keeping this object alive, and which code should I inspect next? The diagrams use an illustrative session cache to explain that process. They are not screenshots or measured results. A retained object is a lead to investigate; understanding its intended lifetime and checking a change remain engineering work. I see AI assistance as one way to make the evidence easier to explore, while the developer remains responsible for the diagnosis.
Sachin Gupta
Read the Original
This page is a summary of: HeapLens: An IDE-Integrated Tool for Heap Dump Analysis with In-Editor Source Bridging and LLM-Assisted Diagnosis, October 2026, ACM (Association for Computing Machinery),
DOI: 10.1145/3837729.3840479.
You can read the full text:
Resources
HeapLens - Demo
In this demo, I open a 14 GB production heap dump and get results in under 11 seconds — powered by a Rust backend with zero-copy memory mapping and a CSR graph engine. No Xmx tuning, no separate tools. I'll walk through: Leak Suspects flagging the top memory retainers instantly HeapQL — a SQL query language with JOINs, GROUP BY, and byte-unit literals (WHERE retained_size > 1MB) Dominator tree, waste detection, and source bridging Comparing two heap dumps side by side HeapLens analyzes 14 GB at 1,300+ MB/s throughput — a 7-8x speedup over the initial implementation. Install: search "HeapLens" in VS Code Extensions Source: https://github.com/sachinkg12/heaplens Docs: https://sachinkg12.github.io/heaplens Marketplace: https://marketplace.visualstudio.com/items?itemName=guptasachinn.heaplens Open-Vsx: https://open-vsx.org/extension/guptasachinn/heaplens License: Apache 2.0
HeapLens source code
Open-source implementation of HeapLens, including the Rust heap analysis engine, editor integration and source navigation.
HeapLens documentation and getting started
Installation, heap analysis concepts, investigation guides, supported interfaces, and privacy controls for optional AI assistance.
Contributors
The following have contributed to this page







