Virtual Memory Simulation


This is a simplified Virtual Memory simulation that shows the basic concepts of VM paging. The applet starts off with 8 processes that take turns referencing memory locations. Dark blue indicates the process is the running one, and light blue indicates the process is ready to run, and is waiting for its turn. There are 16 VM pages and 8 TLB page table entries. Initially the TLB page table entries are white indicating that the page "slot" is empty. As the simulation progress, the running process randomly chooses a page. If the page is a TLB miss, the process changes color to red (indicating that a page fault occured), and the requested page is brought into the TLB replacing an empty slot (if one is available) or the LRU page in the TLB. All "new" pages in the TLB are colored green. If the page is a TLB hit, then the process can either read the page contents or write to it. If the process writes to the page, then the page changes color to yellow indicating that it is dirty and should be copied back to disk before being replaced by another page. At all times, there are lines connecting the TLB pages to the VM pages they are mapped to, and also a line connecting the running process to the TLB page it is accessing.


The sample applet from which I based my simulator.
The source code of my simulator.