This project implements a custom memory allocator in C++ to demonstrate how dynamic memory management works internally. Instead of using built-in functions like malloc or new, this allocator manually manages memory and provides a simple visualization of allocation and deallocation.
- Understand low-level memory management
- Simulate allocation and deallocation of memory blocks
- Study fragmentation and memory usage patterns
- Custom allocation and deallocation functions
- Tracking of free and allocated memory blocks
- Visualization of memory layout
- Modular design with separate components
- Build automation using Makefile
memory_allocator/
│── allocator.cpp
│── allocator.hpp
│── visualizer.cpp
│── visualizer.hpp
│── main.cpp
│── Makefile
git clone <your-repo-link>
cd memory_allocator
make
./memory_allocator
[Free Block: 1000 bytes]
Allocate 200 bytes
[Allocated: 200][Free: 800]
Allocate 300 bytes
[Allocated: 200][Allocated: 300][Free: 500]
Free 200 bytes
[Free: 200][Allocated: 300][Free: 500]
- Dynamic memory allocation
- Pointers and manual memory handling
- Fragmentation
- Basic data structures for memory tracking
- Implement allocation strategies such as First Fit, Best Fit, and Worst Fit
- Improve fragmentation handling
- Add performance comparison with standard allocators
- Extend visualization capabilities
- Internal working of memory allocation
- Challenges in managing memory efficiently
- Importance of memory optimization in system-level programming
This project provides a practical understanding of how memory allocation works at a lower level and highlights the complexity behind commonly used high-level operations.
KARUNISHA R