This program provides a real-time, interactive visualization of memory usage in Rust, focusing on stack and heap allocations.
- Visualizes stack and heap memory usage
- Allows dynamic allocation and deallocation of memory
- Shows stack growth through recursive function calls
- Real-time updates of memory usage
Run the program and use the following commands:
a <size>
: Allocate memory of specified size (in bytes)d
: Deallocate the most recently allocated memoryv
: Force update of the visualizationq
: Quit the program
The program displays:
- A bar graph representing stack and heap usage
- Detailed byte counts for stack and heap
- A visualization of stack growth
- Uses a custom global allocator to track heap usage
- Employs atomic operations for thread-safe memory tracking
- Utilizes ANSI escape codes for console-based visualization
- Rust (stable)
- Colored crate for terminal coloring
cargo build --release
cargo run --release