This project implements a simple memory management system in Python. It simulates memory allocation and deallocation strategies commonly used in operating systems.
The Memory Management System project provides a simulation of memory management techniques used in operating systems. It allows users to create and delete processes, allocate memory for processes, free memory, and convert virtual addresses to physical addresses.
The project is organized as follows:
mmu/
: Contains the source code for the memory management unit.models/
: Contains the definition of MemoryBlock and Process classes.strategy/
: Contains different memory allocation strategy implementations.
main.py
: Main script to run the memory management simulation.README.md
: Documentation file providing information about the project.
To use the Memory Management System, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/your-username/memory-management-system.git
-
Navigate to the project directory:
cd memory-management-system
-
Install the required dependencies:
pip install -r requirements.txt
To run the memory management simulation, execute the main.py
script:
python main.py
Follow the on-screen instructions to interact with the memory management system.
The project implements the following memory allocation strategies:
- First Fit: Allocates the first available memory block that is large enough to accommodate the process.
- Best Fit: Allocates the smallest available memory block that is large enough to accommodate the process.
- Next Fit: Similar to First Fit, but starts searching for available memory from the last allocation position.
- Worst Fit: Allocates the largest available memory block, which may lead to fragmentation but is useful for certain scenarios.
Contributions to the project are welcome! Feel free to submit bug reports, feature requests, or pull requests.