Troubleshooting
Common issues and their solutions when using HeapLens.
Extension Issues
"Rust server binary not found"
The extension cannot find the hprof-server binary.
Solution:
- Verify the binary exists:
ls hprof-analyzer/target/release/hprof-server - If not, build it:
cd hprof-analyzer && cargo build --release - Check file permissions:
chmod +x hprof-analyzer/target/release/hprof-server
Analysis never completes (stuck at "Analyzing...")
The Rust backend may have crashed or hung.
Diagnosis:
- Check the Output channel: View → Output → HeapLens
- Look for progress messages or error traces
- Check if the
hprof-serverprocess is still running:ps aux | grep hprof-server
Common causes:
- Corrupted HPROF file — Incomplete dump (e.g., process was killed during jmap). Try re-capturing.
- Out of memory — The server needs ~3-4x the file size in RAM. Check
Activity Monitor/htop. - Very large file — Files over 1 GB can take several minutes. Wait longer.
Webview is blank or shows only the tab bar
The webview loaded but data was not received.
Solution:
- Close and reopen the
.hproffile - If persistent, open Developer Tools (see Debugging Webview) and check the Console tab for errors
- Ensure
npm run compilewas run after any TypeScript changes
AI Chat says "No API key configured"
Solution:
- Open VS Code Settings (
Cmd+,) - Search for
heaplens.llm - Set
heaplens.llm.apiKeyto your Anthropic or OpenAI API key - Set
heaplens.llm.providerto"anthropic"or"openai"
Build Issues
Rust: cargo build fails with "linking" errors
macOS: Ensure Xcode command line tools are installed:
xcode-select --install
Linux: Install build essentials:
sudo apt install build-essential
Rust: cargo test killed by SIGKILL
On macOS, debug-mode tests can consume excessive memory and trigger the OOM killer.
Solution: Always run tests in release mode:
cargo test --release --lib
TypeScript: npm run compile shows type errors
Ensure dependencies are installed:
npm install
If errors persist, try cleaning:
rm -rf out/ node_modules/
npm install
npm run compile
Analysis Accuracy Issues
Retained sizes don't match Eclipse MAT
Small differences (5-10%) between HeapLens and Eclipse MAT are expected due to:
- Different handling of unreachable objects
- Slight differences in edge extraction for complex inheritance chains
- HeapLens uses
reachable_heap_sizeas the denominator for percentages (matching MAT)
If differences are larger, check:
- Is the HPROF file the same? (MAT sometimes re-parses)
- Is the file complete? (truncated files produce different results)
No leak suspects detected
Leak suspects require at least one object or class retaining >5% of the reachable heap. If memory is evenly distributed, no suspects will be flagged.
What to try:
- Check the Histogram tab for classes with unusually high instance counts
- Look at the Dominator Tree top entries manually
- Use the AI Chat to ask about memory patterns
Waste analysis shows 0% waste
This can happen if:
- The heap has very few
java.lang.Stringinstances (e.g., a non-Java-standard JVM) - All strings are unique (no duplicates)
- No empty
HashMap,ArrayList, orLinkedHashMapinstances
Performance Issues
Analysis takes too long
| File Size | Expected Time | If Slower |
|---|---|---|
| < 50 MB | < 5s | Check if other processes are consuming CPU |
| 50-200 MB | 5-15s | Normal |
| 200 MB - 1 GB | 15-60s | Normal; consider more RAM |
| > 1 GB | 1-5 min | Close other applications to free RAM |
Optimization tips:
- Close unnecessary applications to free RAM (the server needs ~3-4x file size)
- Use an SSD — memory-mapped I/O is faster with SSD page cache
- The first analysis of a file is slower; the OS caches pages for subsequent runs
Extension Development Host is slow
When developing:
- Use
npm run watchinstead ofnpm run compilefor incremental builds - Disable other extensions in the Development Host to isolate performance