A terminal-based visualization tool for memory allocation and management with a Matrix-inspired interface.
This application provides a real-time visualization of memory allocation concepts including:
- Paging
- Segmentation
- Memory usage statistics
- Fragmentation metrics
The interface is designed with a Matrix-inspired color scheme for a visually engaging experience.
- Real-time memory usage visualization
- Page allocation and deallocation simulation
- Memory segmentation visualization
- System memory statistics
- Fragmentation rate calculation
- Matrix-style animations
a- Allocate memory (random size)d- Deallocate memory (last allocated segment)q- Quit applicationEscorCtrl+C- Exit application
The application simulates memory allocation using two models:
- Paging: Fixed-size memory blocks (4KB each)
- Segmentation: Variable-size memory blocks
When you allocate memory (by pressing 'a'), the application:
- Finds contiguous free pages
- Allocates 1-3 pages at once
- Assigns a random process ID
- Updates the visualization
When you deallocate memory (by pressing 'd'), the application:
- Removes the last allocated segment
- Frees all pages associated with that process ID
- Updates the visualization
- Go 1.16 or higher
- Required packages:
- github.com/gdamore/tcell/v2
- github.com/rivo/tview
- github.com/shirou/gopsutil
- Ensure Go is installed on your system
- Install the required dependencies: