An AI-enhanced Virtual Memory Manager (VMM) simulator with real-time dashboard visualization.
This project implements a comprehensive Virtual Memory Management system with three main components:
- C++ Backend Simulator - Core VMM logic with HTTP API
- Python AI Predictor - Machine learning-based page prediction service
- React Frontend Dashboard - Real-time visualization and control interface
- Virtual Memory Management: Page tables, page replacement algorithms (FIFO, LRU, Clock)
- AI-Enhanced Predictions: Machine learning models for page prefetching and eviction hints
- Real-time Dashboard: Live metrics, charts, and simulation control
- Multiple Workload Types: Sequential, Random, Strided, DB-like access patterns
- Server-Sent Events: Real-time log streaming and event updates
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ React Frontend│ │ C++ Backend │ │ Python AI │
│ (Port 3000) │◄──►│ (Port 8080) │◄──►│ Predictor │
│ │ │ │ │ (Port 5000) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- C++ Compiler (MSVC on Windows, GCC/Clang on Linux/macOS)
- CMake (3.10 or higher)
- Python 3.8+ with pip
- Node.js 16+ with npm
cd predictor
pip install -r requirements.txt
python -m uvicorn predictor.service:app --host 0.0.0.0 --port 5000cd backend
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cd bin/Release
./vmm_simulator.exe # Windows
# or
./vmm_simulator # Linux/macOScd frontend
npm install
npm run devOpen your browser and navigate to:
- Frontend Dashboard: http://localhost:3000
- Backend API: http://localhost:8080
- AI Predictor: http://localhost:5000
GET /metrics- Get simulation metricsPOST /simulate/start- Start simulationPOST /simulate/stop- Stop simulationGET /events/stream- Server-Sent Events stream
GET /health- Health checkPOST /predict- Get page predictionsGET /model/info- Model information
For easy deployment, use Docker Compose:
docker-compose up --buildThis will start all three services with proper networking and health checks.
VMMConfig vmm_config{
.total_frames = 256, // Number of physical frames
.page_size = 4096, // Page size in bytes
.total_pages = 1024, // Total virtual pages
.replacement_policy = ReplacementPolicy::CLOCK,
.enable_ai_predictions = true,
.ai_predictor_url = "http://localhost:5000/predict"
};WorkloadConfig workload_config{
.type = WorkloadType::RANDOM, // Workload pattern
.total_requests = 1000, // Number of memory accesses
.page_range = 1000, // Range of page numbers
.stride = 1, // Stride for strided access
.zipf_alpha = 1.0, // Zipf distribution parameter
.locality_factor = 0.8, // Locality factor for webserver workload
.working_set_size = 100 // Working set size
};-
Backend:
cd backend mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release
-
Frontend:
cd frontend npm install npm run build -
AI Predictor:
cd predictor pip install -r requirements.txt
Run the connectivity test:
python test_connectivity.pyRun the system validation:
python validate_system.pyVirtual-Memory-Manager/
├── backend/ # C++ VMM Simulator
│ ├── src/ # Source code
│ ├── include/ # Headers
│ ├── build/ # Build output
│ └── CMakeLists.txt # Build configuration
├── frontend/ # React Dashboard
│ ├── src/ # React components
│ ├── public/ # Static assets
│ └── package.json # Dependencies
├── predictor/ # Python AI Service
│ ├── models/ # ML models
│ ├── service.py # FastAPI app
│ └── requirements.txt # Python dependencies
├── docker-compose.yml # Container orchestration
└── README.md # This file
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Aditya Pandey - Initial work and development
- Virtual Memory Management concepts and algorithms
- React and FastAPI frameworks
- Machine Learning for page prediction
- Real-time web technologies (SSE, WebSockets)