-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalgorithm4.html
More file actions
107 lines (95 loc) · 4.09 KB
/
Copy pathalgorithm4.html
File metadata and controls
107 lines (95 loc) · 4.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Optimal Page Replacement Simulator</title>
<link rel="stylesheet" type="text/css" href="algorithm4.css">
<link rel="stylesheet" href="animation.css">
</head>
<body>
<header>
<h1 class="logo">OPERATING SYSTEM PROJECT</h1>
<nav>
<ul class="nav-links">
<li><a href="index.html">Home</a></li>
<li><a href="read_more.html">Documentation</a></li>
<!-- <li><a href="simulators.html" target="_blank">Simulators</a></li> -->
<li class="dropdown">
<a href="simulator.html" class="dropbtn">Simulators</a>
<div class="dropdown-content">
<a href="priority_preemptive.html">Priority Preemptive</a>
<a href="fcfs_disk_scheduling.html">FCFS Disk Scheduling</a>
<a href="petersons.html">Peterson's Solution</a>
<a href="optimal_page_replacement.html">Optimal Page Replacement</a>
</div>
</li>
<li><a href="team.html">About Us</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</nav>
</header>
<section class="container_docs" data-aos="zoom-in-up">
<h1>What is Optimal Page Replacement Algorithm</h1>
<p>The optimal page replacement algorithm is a theoretical algorithm that selects the page for replacement that
will not be
used for the longest period of time in the future. This algorithm is impossible to implement in practice as
it requires
knowledge of future page requests, but serves as a performance benchmark for other page replacement
algorithms.
<br>
</p>
<h4>
<li>Terms related to Optimal Page Replacement Algorithm</li>
</h4>
<p>Page: a fixed size block of memory used to store data and code from a process.<br><br>
Page fault: occurs when a program attempts to access a page that is not currently in memory. The operating
system must then fetch the page from secondary storage (such as a hard disk) and load it into memory, which
can be slow and impact performance. <br><br>
Hit ratio: the percentage of page accesses that result in a page hit (i.e., the page is already in memory).
A higher hit ratio indicates that a page replacement algorithm is performing well. <br><br>
Page replacement is a process of moving a page from memory to disk and loading a new page into memory when
the available memory becomes full. This technique allows the operating system to efficiently manage the
limited physical memory available on a computer. <br><br>
</p>
<h4>
<li>Disadvantages of Peterson's Solution</li>
</h4>
<p>The main disadvantage of optimal page replacement algorithm is that it is impossible to implement in practice
because it requires knowledge of future page requests. As a result, it serves as a theoretical benchmark for
other algorithms, but cannot be used as a practical solution. Additionally, the algorithm is not efficient
for real-time systems because it requires a lot of processing power to calculate the optimal page
replacement decision.
</p>
<br>
<!-- </section>
<h1>Optimal Page Replacement</h1>
<div class="box">
<label for="">Enter page reference string:</label>
<input type="text" id="inputString" placeholder="Eg. 1 2 4 3 6 5 1 2 5">
<br>
<label>Enter number of frames: </label>
<input type="number" id="inputFrames" placeholder="Eg. 3">
<br>
<button onclick="runOptimalPageReplacement()">Run</button>
<br><br>
</div>
<table id="outputTable"></table>
<div id="ratio_result"></div>
<script src="script_page.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<canvas id="myChart"></canvas> -->
<div class="prompt">
<button id="prompt-button">
<img src="quiz.jpg" alt="Chatbot Icon">
</button>
</div>
<script>
const promptButton = document.getElementById("prompt-button");
promptButton.addEventListener("click", function() {
window.location.href = "quiz.html";
});
</script>
</body>
</html>