Question: Write a program that implements the LRU (Least Recent Used) page replacement algorithm in Java, presented in the virtual memory management of the Memory Management
Write a program that implements the LRU (Least Recent Used) page replacement algorithm in Java, presented in the virtual memory management of the Memory Management Unit (MMU). Assume that demand paging is used. The reference code package is given.
Inputs: The program should accept two inputs: the size of a page-reference string and the number of page frames of the RAM. Both inputs should be variable, not hardcoded. The page-reference string has page numbers ranging from 0 to 9.
Output: The output of the program is the number of page faults and the number of page replacements incurred by the algorithm.
Based on the provided reference code package, first, generate a random page-reference string where page numbers range from 0 to 9. Then design and implement a classLRUthat extend ReplacementAlgorithm. The class will implement the insert() method using the LRU page-replacement algorithm.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
