subject

Write a simulation to analyze different memory page replacement algorithms. you need to implement a simple simulator of page replacement policies, assuming a single running process and a fxed size physical memory. overview you simulator should allow the page size and physical memory size (# of address bits) as command-line arguments. the simulation should support at least three page replacement policies: random, fifo, and lru. the page size must be a number of power of 2 between 256 (2^8) and 8192 (2^13) bytes inclusively. the physical memory size is also power of 2. assume that when the simulation start, the physical memory is empty, i. e. all page table entries are invalid. as they are brought in, the simulator should make sure that the total number of pages in memory should never exceed the physical memory size. the simulator should read a sequence of logical memory references from a file (references. txt). this file contains a list of virtual (logical) memory byte addresses accessed by a program. in this simulation, the maximum virtual memory address is 128 mb (2 27bytes) and the number of addresses in the file is 5,000,000. in this simulation, the least significant bit is used to differentiate between a read access (0, i. e. even number) or write access (1, i. e. odd number). for example, the value 1220149 means a write reference to memory location 1220148. those addresses can be assumed to be aligned at a two-byte boundary, i. e., they are always even. we can safely play this simple trick because the minimum page size is 256 bytes, so the eight least significant bits of an address are irrelevant to the page number anyway. your program should keep track of pages in the memory and free frames. therefore you need to maintain a pagetable data structure, which can be easily implemented as an array of page-table entries, and a free-frame list. the number of pages is dependent on the page size. in the pagetable entry data structure, you need additional fields, e. g. valid and dirty bits, besides the mapped frame number of the page. for each memory reference, find out its page number and whether this page is in the main memory. if the memory reference is a write, this page is marked dirty. if this page is not in the main memory, a page fault is generated and this page is loaded into the main memory. however, if the main memory is full, a victim page must be selected and evicted according a page replacement algorithm. your simulation is to compare different page replacement algorithms. notice you may need to keep track of additional information such as last page access time for the lru (least recently used) algorithm.

required output

• this program should collect and print the following statistics for different algorithms: the total number of memory references. the total number of page faults. the total number of flushes, i. e., cases when the victim page was dirty. the total time it took the simulator to produce the results. • in addition to a program printout, the results of algorithm should be analyzed and written in the reprot. you should thoroughly test your program with several different page sizes (256 - 8192 bytes) and physical memory sizes (e. g. 4 mb, 16 mb, 32 mb, 64 mb)

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, Dweath50
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
image
Computers and Technology, 24.06.2019 17:30, leenzazou98241
What is the next step if your volume does not work on computer
Answers: 2
image
Computers and Technology, 25.06.2019 18:00, minie66
Bigmart supermarket has different ways of awarding discounts to its customers for each purchase they make. an 8 percent discount is given on the total value of the purchase. in addition, a standard loyalty discount is given if customers have a permanent customer id card. your program should indicate the amount payable by the customer after the discounts. identify the inputs that the program requires from these options: i. the discount percentage ii. the total value of the purchase iii. the loyalty-discount amount iv. the customer id card number v. the amount payable after discount
Answers: 2
image
Computers and Technology, 25.06.2019 21:30, domie5910
What is an example of the personal information that an identity thief would look for
Answers: 2
You know the right answer?
Write a simulation to analyze different memory page replacement algorithms. you need to implement a...

Questions in other subjects: