Skip to content

hichammh/ferroalloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ferroalloc

Real-time Rust heap memory visualization directly in VS Code.

CI VS Code Marketplace Installs ferroalloc-probe on crates.io

ferroalloc demo

What it does

Ferroalloc shows live heap memory stats inside VS Code as your Rust program runs:

  • CodeLens β€” allocation count and total bytes above each line that allocates
  • Heatmap β€” lines colored green β†’ red by allocation volume
  • Leak detection β€” lines with unfreed allocations flagged with ⚠
  • Snapshot diff β€” compare memory state before and after a workload

Quick Start

1 β€” Install the VS Code extension

Search "ferroalloc" in the VS Code Extensions panel, or:

ext install hichammh.ferroalloc

2 β€” Install the analyzer

cargo install ferroalloc-analyzer

3 β€” Add the probe to your Rust project

# Cargo.toml
[dependencies]
ferroalloc-probe = "0.1"
// src/main.rs
use ferroalloc_probe::{FerroAllocator, start_flush_thread};

#[global_allocator]
static ALLOC: FerroAllocator = FerroAllocator;

fn main() {
    start_flush_thread(7777);
    // ... rest of your program
}

4 β€” Run

# Terminal 1 β€” start the analyzer
ferroalloc-analyzer

# Terminal 2 β€” run your program
cargo run

Then in VS Code: Cmd+Shift+P β†’ Ferroalloc: Start Memory Tracking

Architecture

Your Rust app                Analyzer              VS Code Extension
─────────────────            ────────────          ──────────────────
FerroAllocator               ferroalloc-           ferroalloc
  (GlobalAlloc)   ─TCP:7777─▢ analyzer   ─HTTP:7778─▢ extension
  captures every             aggregates            CodeLens + heatmap
  alloc/dealloc              by file:line          + leak panel
  resolves symbol
  at runtime

Project structure

ferroalloc/
β”œβ”€β”€ probe/             # ferroalloc-probe crate (add to your project)
β”œβ”€β”€ analyzer/          # ferroalloc-analyzer binary (install on your machine)
└── vscode-extension/  # VS Code extension (install from marketplace)

Configuration

Setting Default Description
ferroalloc.analyzerPort 7778 HTTP port of the analyzer API
ferroalloc.refreshIntervalMs 1000 Poll interval in milliseconds
ferroalloc.heatmapEnabled true Enable/disable background heatmap

License

MIT

About

πŸ¦€ VS Code extension: real-time Rust heap memory visualization via CodeLens

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors