Skip to content

Machine Learning based Page Replacement Algorithm using Reinforcement Learning (DQN)

Notifications You must be signed in to change notification settings

prashant1039/ml_page_replacement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ML-Based Page Replacement System

An intelligent machine learning–driven page replacement simulator that predicts future memory accesses to reduce page faults in virtual memory management. This project compares ML-based predictions with traditional algorithms such as LRU and FIFO.


πŸš€ Features

  • Predicts optimal page eviction using machine learning
  • Simulates memory access traces
  • Compares performance with LRU and FIFO algorithms
  • Measures hit ratio and page fault rates
  • Visualizes performance using graphs

πŸ›  Tech Stack

  • Python
  • NumPy
  • Pandas
  • Scikit-learn
  • Matplotlib

πŸ“‚ Project Structure

ml-page-replacement/
β”‚
β”œβ”€β”€ data/               # Memory trace datasets
β”œβ”€β”€ models/             # Trained ML models
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ simulator.py    # Page replacement simulator
β”‚   β”œβ”€β”€ ml_model.py     # ML training and prediction
β”‚   └── utils.py        # Helper functions
β”‚
β”œβ”€β”€ results/            # Performance outputs and graphs
└── README.md

βš™οΈ Installation

  1. Clone the repository:
git clone https://github.com/prashant1039/ml_page_replacement.git
cd ml_page_replacement
  1. Install dependencies:
pip install numpy pandas scikit-learn matplotlib

▢️ Usage

Run the simulator:

python src/simulator.py

The program will:

  • Train the ML model
  • Simulate memory access patterns
  • Compare results with LRU and FIFO
  • Display performance graphs

πŸ“Š Results

The ML-based approach improves prediction of future page accesses and demonstrates:

  • Reduced page faults
  • Higher hit ratio
  • Better adaptability to access patterns

🎯 Learning Outcomes

  • Understanding of virtual memory management
  • Application of machine learning to systems problems
  • Performance benchmarking and evaluation
  • Data preprocessing and model training

🀝 Contributing

Contributions are welcome! Feel free to fork the repository and submit pull requests.


πŸ“œ License

This project is open source and available under the MIT License.


πŸ‘€ Author

Prashant Singh

About

Machine Learning based Page Replacement Algorithm using Reinforcement Learning (DQN)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages