Question #2: FIFO Page Replacement [10 pts]
We now enhance things further, in class Virtual MemoryManagerV2, so that we can handle an address space that's larger than RAM space. Essentially, what your code must
do is:
• Keeps a list of free frames;
• Evicts a victim page whenever a new page must be brought in and there are insufficient free frames;
• Always selects the victim as the page that was brought into memory the longest time ago (your page table entries could keep track of some notion of time, or you could
keep a FIFO data structure of page numbers that is separate from the page table);
• Always write a victim page back to disk.
Run the command:
java vmsimulation/Simulator V2
to see the expected command-line arguments for invoking the simulator. The last command-line argument is a measure of locality when generating memory transactions
that's used by the simulator (see the last question).
All the above is to be implemented in a class called Virtual Memory ManagerV2. Make a copy of your Virtual Memory ManagerV1. java file, renaming it
Virtual MemoryManagerV2.java and use it as a starting point.
Your implementation must now produce some output to say which page is being evicted back to disk. For instance, here is an example invocation for a 8-byte memory, 32-
byte disk, 4-byte page size, 4 memory transactions (4 reads and 4 writes), a seed of 1 for the random number generator, and a locality of 0, which is done with: