Project: Virtual Memory Manager Simulator
Authors: Aditya Pandey, Kartik, Vivek, Gaurang
Date: 2025
Purpose: Educational operating systems tool for learning virtual memory management
A comprehensive, production-quality virtual memory simulator that demonstrates core OS memory management concepts through both command-line and interactive web interfaces. The project provides hands-on experience with:
- Virtual-to-physical address translation
- Translation Lookaside Buffer (TLB) caching
- Demand paging and page fault handling
- Page replacement algorithms
- Swap space management
- Multi-process memory isolation
Role: Lead Developer & System Architect
- VMM core orchestration and address translation pipeline
- Frame allocator with bitmap optimization
- Swap manager implementation
- Main CLI interface and configuration system
- System-level integration and testing
Role: Memory Subsystems Developer
- Page table implementation (single & two-level)
- All page replacement algorithms (FIFO, LRU, Clock, OPT, Approx-LRU)
- Page table entry management
- Algorithm optimization and analysis
Role: Performance & Metrics Engineer
- Complete TLB simulation with multiple policies
- Comprehensive metrics collection framework
- Multi-format reporting (JSON, CSV, console)
- Performance instrumentation (AMT calculation)
- TLB optimization strategies
Role: Testing & QA Lead
- Trace parsing and generation engine
- Five synthetic trace patterns
- Complete automated test suite (10 tests)
- Comprehensive documentation (4 major docs)
- Quality assurance and validation
- Web-based GUI development
- Interactive visualization system
- Code reviews and pair programming
- Architecture and design decisions
- User documentation and examples
Source Code (10 modules):
main.c- CLI interface (261 lines)vmm.c- Core VMM logic (340 lines)pagetable.c- Page table management (220 lines)frame.c- Frame allocator (203 lines)tlb.c- TLB simulation (160 lines)swap.c- Swap manager (120 lines)replacement.c- Replacement algorithms (268 lines)trace.c- Trace engine (200 lines)metrics.c- Metrics collection (351 lines)util.c- Utilities (80 lines)
Total: ~2,200 lines of well-documented, production-quality C code
Files:
index.html- Modern responsive UIstyle.css- Professional styling with animationssimulator.js- Core simulation logic in JavaScriptapp.js- UI controller and visualization
Features:
- Real-time TLB, page table, and frame visualization
- Interactive configuration panel
- Performance charts (Chart.js integration)
- Event logging system
- Responsive design for all screen sizes
- Makefile - Complete build automation (132 lines)
- CMakeLists.txt - Alternative CMake support
- Multiple targets: debug, release, test, traces, valgrind
- Automatic dependency tracking
-
10 Automated Tests:
- Trace generation
- FIFO algorithm
- LRU algorithm
- Clock algorithm
- OPT algorithm
- TLB size comparison
- Multi-process workload
- Thrashing scenario
- Two-level page tables
- Different page sizes
-
Test Runner:
tests/run_tests.shwith colored output -
Sample Traces: 5+ pre-generated trace files
-
Validation: Metrics verification, memory leak checks
User Documentation:
README.md- Complete user guide (295 lines)QUICKSTART.md- 5-minute getting started guidegui/README.md- Web GUI documentation
Developer Documentation:
DESIGN.md- Architecture and design decisions (500+ lines)API.md- Developer API reference (600+ lines)TESTPLAN.md- Testing strategy and acceptance criteria (500+ lines)EXTENSIONS.md- Optimization roadmap (400+ lines)
Project Documentation:
AUTHORS.md- Detailed author contributionsPROJECT_SUMMARY.md- This document
traces/simple.trace- Manual verification tracetraces/*.trace- 5 generated trace patterns- Example configuration files
- Expected output samples
✅ Single-level and two-level page tables
✅ Configurable page size (4KB, 8KB, 16KB, etc.)
✅ Dynamic frame allocation with free-list
✅ TLB with FIFO and LRU policies
✅ Five replacement algorithms (FIFO, LRU, Approx-LRU, Clock, OPT)
✅ Demand paging with page fault handling
✅ Swap space simulation with I/O latency
✅ Multi-process support with isolation
✅ Approximate LRU using aging counters
✅ Optimal (Belady) algorithm for comparison
✅ Comprehensive metrics collection
✅ Multi-format output (console, JSON, CSV)
✅ Configurable access time simulation
✅ Deterministic trace generation with seeding
✅ Zero memory leaks (valgrind verified)
✅ Address sanitizer clean
✅ Comprehensive error handling
✅ Debug and release build modes
✅ Extensive logging system
✅ Code formatting with clang-format
Development:
- Lines of Code: ~3,500 (C + JavaScript)
- Documentation: ~2,000 lines
- Test Coverage: 10 automated tests
- Files Created: 40+ files
- Development Time: Complete implementation
Capabilities:
- Maximum RAM: 1GB+ supported
- Address Space: 64-bit (4GB default)
- TLB Size: 4-256 entries
- Trace Size: Tested up to 1M accesses
- Processes: Up to 16 concurrent
Performance:
- Simulation Speed: ~100,000 accesses/second
- Memory Efficiency: <2GB for 1GB RAM simulation
- Build Time: <5 seconds
- Test Suite: Completes in <30 seconds
-
Virtual Memory Management
- Address translation mechanisms
- Multi-level page tables
- Sparse vs dense address spaces
-
Caching & Performance
- TLB importance and effectiveness
- Locality of reference
- Cache replacement policies
-
Page Replacement
- Five different algorithms
- Belady's anomaly demonstration
- Working set behavior
-
Memory Hierarchy
- RAM vs Swap tradeoffs
- Thrashing identification
- Performance optimization
-
System Design
- Modular architecture
- Policy vs mechanism separation
- Performance vs complexity tradeoffs
- OS Course Labs: Hands-on VM experiments
- Research: Algorithm comparison studies
- Self-Learning: Interactive visualization
- Demonstrations: Real-time OS behavior
- Performance Analysis: Metric collection
Languages:
- C11 (primary implementation)
- JavaScript ES6 (GUI)
- HTML5/CSS3 (interface)
- Bash (build scripts)
Tools & Libraries:
- GCC/Clang compiler
- GNU Make / CMake
- Chart.js (visualization)
- Valgrind (memory checking)
- Address Sanitizer
Standards:
- POSIX-compliant C
- ISO C11 standard
- Modern web standards
✅ All required features implemented
✅ All documentation completed
✅ All tests passing
✅ Bonus GUI delivered
✅ Production-level code quality
✅ Comprehensive error handling
✅ Memory-safe (verified)
✅ Well-documented API
✅ Web-based visualization (beyond requirements)
✅ Multiple output formats
✅ Extensive trace patterns
✅ Professional GUI design
✅ Easy to build and run
✅ Clear documentation
✅ Helpful examples
✅ Intuitive interface
- Web GUI:
cd gui && python3 -m http.server 8000 - Command Line:
make && ./bin/vmm -t traces/working_set.trace -a LRU - Read:
QUICKSTART.mdfor 5-minute guide
- Read:
DESIGN.mdfor architecture - API:
API.mdfor extension points - Build:
make debugfor development - Test:
make testto validate
- Generate traces:
./bin/trace_gen -t <pattern> -n 10000 -o trace.txt - Compare algorithms: Run multiple configs, output to CSV
- Analyze: Import CSV into Excel/Python for analysis
As documented in EXTENSIONS.md:
- Copy-on-Write (COW) fork semantics
- Shared memory regions
- Memory-mapped file simulation
- Large pages (huge pages)
- Prefetching strategies
- NUMA simulation
- Multi-level (3+) page tables
- Advanced replacement (WSClock)
Performance optimizations:
- Hash tables for sparse page tables
- Multi-threading support
- SIMD for frame aging
- JIT compilation of policies
By working on this project, the team gained expertise in:
Technical Skills:
- Low-level systems programming in C
- Data structure design and optimization
- Algorithm implementation and analysis
- Web development (HTML/CSS/JavaScript)
- Build systems and automation
- Testing and quality assurance
Software Engineering:
- Modular architecture design
- API design and documentation
- Code review and collaboration
- Version control best practices
- Performance optimization
- Debugging techniques
Operating Systems:
- Virtual memory internals
- Memory management algorithms
- Performance measurement
- System call implementation
- Multi-process coordination
This VMM Simulator represents a complete, professional-grade educational tool that successfully demonstrates core virtual memory management concepts. The project combines:
- Solid Engineering: Clean, efficient, well-tested C code
- Great UX: Both CLI and beautiful web GUI
- Comprehensive Docs: Everything needed to use and extend
- Team Collaboration: Four developers working effectively together
The project is ready for:
- ✅ Classroom use in OS courses
- ✅ Self-paced learning and exploration
- ✅ Research and algorithm comparison
- ✅ Further development and extension
Development Team:
- Aditya Pandey
- Kartik
- Vivek
- Gaurang
Copyright: © 2025 - All authors
License: Educational use
Repository: [Your repository link]
Thank you for exploring the VMM Simulator!
"Understanding virtual memory is understanding how modern computers work."
- README - Main documentation
- QUICKSTART - Get started in 5 minutes
- GUI Guide - Web interface help
- Design Doc - Architecture details
- API Reference - Developer guide
- Test Plan - Testing strategy
- Extensions - Future enhancements
- Authors - Detailed contributions