You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-36
Original file line number
Diff line number
Diff line change
@@ -4,65 +4,72 @@
4
4
5
5
### Table of contents
6
6
7
-
-[Introduction](#introduction)
8
-
-[Demonstration](#demonstration)
9
-
-[Algorithms](#algorithms)
10
-
-[Local Setup](#local-setup)
11
-
-[Author](#author)
12
-
-[License](#license-)
7
+
-[Introduction](#introduction)
8
+
-[Demonstration](#demonstration)
9
+
-[Algorithms](#algorithms)
10
+
-[Local Setup](#local-setup)
11
+
-[Author](#author)
12
+
-[License](#license-)
13
13
14
-
## *Introduction*
14
+
## _Introduction_
15
15
16
16
A simple Memory Allocation Simulatory built with JAVA, for a better understanding of how memory allocation works in an **Operating System**. It simulates common **memory allocation strategies**:
17
17
18
-
-**First-Fit**
19
-
-**Best-Fit**
20
-
-**Worst-Fit**
18
+
-**First-Fit**
19
+
-**Best-Fit**
20
+
-**Worst-Fit**
21
+
22
+
This repository also contains the code for
23
+
24
+
- Scheduling Algorithms
25
+
- Page Replacement Algorithms
26
+
- Paging Simulator
27
+
- Disk Scheduling Policies
21
28
22
29
## Demonstration
23
30
24
-
- Welcome to the Memory Allocation Simulator.
25
-
- First, we ask whether the user wants to enter a values or not, if not, then a few values are already hardcoded.
26
-
- The hardcoded values are important for understanding, debugging and saving time.
31
+
-Welcome to the Memory Allocation Simulator.
32
+
-First, we ask whether the user wants to enter a values or not, if not, then a few values are already hardcoded.
33
+
-The hardcoded values are important for understanding, debugging and saving time.
27
34
28
35

29
36
30
-
- After taking the input value of the Memory Divisions, their current status (Free/Not Free) and the process numbers, we print the current table of the Memory Allocation.
37
+
-After taking the input value of the Memory Divisions, their current status (Free/Not Free) and the process numbers, we print the current table of the Memory Allocation.
31
38
32
39

33
40
34
-
- So now, we take the size of the input process, and a menu comes up.
41
+
-So now, we take the size of the input process, and a menu comes up.
35
42
36
43

37
44
38
-
- Output for the First Fit
45
+
-Output for the First Fit
39
46
40
47

41
48
42
-
- Output for the Best Fit
49
+
-Output for the Best Fit
43
50
44
51

45
52
46
-
- Output for the Worst Fit
53
+
-Output for the Worst Fit
47
54
48
55

49
56
50
57
## Algorithms
51
58
52
59
A simple Memory Allocation Simulatory built with JAVA, for a better understanding of how memory allocation works in an **Operating System**. It simulates common **memory allocation strategies**:
53
60
54
-
-**First-Fit**
55
-
- In the first fit approach is to allocate the first free partition or hole large enough which can accommodate the process.
56
-
-*Advantage*: It finishes after finding the first suitable free partition. **Fastest algorithm because it searches as little as possible.**
57
-
-*Disadvantage*: **Internal Fragmentation** - The remaining unused memory areas left after allocation become waste if it is too smaller. Thus, request for larger memory requirement cannot be accomplished.
58
-
-**Best-Fit**
59
-
- The best fit deals with allocating the smallest free partition which meets the requirement of the requesting process. This algorithm first searches the entire list of free partitions and considers the smallest hole that is adequate.
60
-
-*Advantage*: It then tries to find a hole which is close to actual process size needed. Memory utilization is much better than first fit as it searches the smallest free partition first available.
61
-
-*Disadvantage*: It is slower and may even tend to fill up memory with tiny useless holes.
62
-
-**Worst-Fit**
63
-
- In worst fit approach is to locate largest available free portion so that the portion left will be big enough to be useful. It is the reverse of best fit.
64
-
-*Advantage*: Reduces the rate of production of small gaps.
65
-
-*Disadvantage*: If a process requiring larger memory arrives at a later stage then it cannot be accommodated as the largest hole is already split and occupied.
61
+
-**First-Fit**
62
+
- In the first fit approach is to allocate the first free partition or hole large enough which can accommodate the process.
63
+
-_Advantage_: It finishes after finding the first suitable free partition. **Fastest algorithm because it searches as little as possible.**
64
+
-_Disadvantage_: **Internal Fragmentation** - The remaining unused memory areas left after allocation become waste if it is too smaller. Thus, request for larger memory requirement cannot be accomplished.
65
+
-**Best-Fit**
66
+
- The best fit deals with allocating the smallest free partition which meets the requirement of the requesting process. This algorithm first searches the entire list of free partitions and considers the smallest hole that is adequate.
67
+
-_Advantage_: It then tries to find a hole which is close to actual process size needed. Memory utilization is much better than first fit as it searches the smallest free partition first available.
68
+
-_Disadvantage_: It is slower and may even tend to fill up memory with tiny useless holes.
69
+
-**Worst-Fit**
70
+
- In worst fit approach is to locate largest available free portion so that the portion left will be big enough to be useful. It is the reverse of best fit.
71
+
-_Advantage_: Reduces the rate of production of small gaps.
72
+
-_Disadvantage_: If a process requiring larger memory arrives at a later stage then it cannot be accommodated as the largest hole is already split and occupied.
66
73
67
74
---
68
75
@@ -88,13 +95,13 @@ If input process is of size 200 KB, then:
88
95
89
96

90
97
91
-
## *Local Setup*
98
+
## _Local Setup_
92
99
93
-
* Download the latest version of Java - [Java SE - Downloads | Oracle](https://www.oracle.com/java/technologies/javase-downloads.html).
94
-
* Clone the repository: `git clone https://github.com/tusharnankani/MemoryAllocationSimulator.git`
95
-
* Open this directory in Command Promt or Shell.
96
-
* Compile the file using the command: `javac MemoryAllocation.java`
97
-
* Run the file using the command: `java MemoryAllocation`
100
+
- Download the latest version of Java - [Java SE - Downloads | Oracle](https://www.oracle.com/java/technologies/javase-downloads.html).
101
+
- Clone the repository: `git clone https://github.com/tusharnankani/MemoryAllocationSimulator.git`
102
+
- Open this directory in Command Promt or Shell.
103
+
- Compile the file using the command: `javac MemoryAllocation.java`
104
+
- Run the file using the command: `java MemoryAllocation`
0 commit comments