This project simulates memory allocation and deallocation in an operating system, evaluating two memory allocation techniques: First Fit and Best Fit. The simulation employs a linked list to manage memory usage.
The purpose of this memory allocation simulation project is to create a platform for studying and evaluating two fundamental memory allocation techniques, namely First Fit and Best Fit, commonly used in operating systems. Memory allocation plays a crucial role in the efficient utilization of a computer's main memory, impacting system performance and resource management.
This program also demonstrates the application and utilization of pointers and linked lists in C++.
To run the simulation, we generate 10,000 memory allocation and deallocation requests using the Request Generation component. For each request, we invoke the appropriate function of the Memory component for both memory allocation techniques. After each request, the performance parameters are updated.
- Memory is 256KB each.
- A process may request between 3 and 10 units of memory.
- Memory is requested for each process only once.
- The entire memory allocated to a process is deallocated on a deallocation request.
- Clone this repository to your local machine.
- Build the executables with the following command: make ./sim
- Run the program with the following command: ./sim
At the end of the simulation, the simulation statistics will print the performance parameters for both memory allocation techniques.