Operating System Concepts: Internal vs. External Fragmentation

Verified

Added on  2021/06/16

|7
|636
|43
Homework Assignment
AI Summary
This document presents a completed Operating System assignment, addressing key concepts and problems. The first part of the solution explains the differences between internal and external fragmentation, providing examples and potential solutions such as compaction, paging, and segmentation. The second part delves into page replacement algorithms, specifically the LRU (Least Recently Used) algorithm, and demonstrates the page replacement order. The assignment then explores CPU scheduling algorithms, including FCFS (First-Come, First-Served), SJN (Shortest Job Next), SRT (Shortest Remaining Time), and Round Robin, mentioning turnaround time and waiting time. The assignment concludes with a bibliography citing relevant research papers on memory management and scheduling algorithms. This comprehensive assignment offers valuable insights into core Operating System principles and practical applications.
Document Page
Running head: OPERATING SYSTEM
Operating System
Name of the Student:
Name of the University:
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
OPERATING SYSTEM
Answer to question number 1
a. The difference in between internal and external fragmentation are provided in the table
below:
Internal fragmentation External fragmentation
When a process is allocated more memory
than required, few space is left unused and
this is called as INTERNAL
FRAGMENTATION.
After execution of processes when they are
swapped out of memory and other smaller
processes replace them, many small
noncontiguous (adjacent) blocks of unused
spaces are formed which can serve a new
request if all of them are put together but as
they are not adjacent to each other a new
request can't be served and this is known as
EXTERNAL FRAGMENTATION
For example the internal fragmentation occurs
when the division of the memory is done into
to fixed sizes.
For example the external fragmentation
occurs when the division of the memory is
done into to variable sizes.
The possible solution to this is allocation of
memory is done dynamically.
It can be cured by Compaction, Paging and
Segmentation.
b. The memory is allocated to a pool and the memory becomes fragmented. The objects
would be allocated into the system with the help of the compaction techniques. Basically,
taking filled chunks of memory and making them adjacent to one another, address-wise.
Similarly with empty chunks of memory, though this is a natural consequence of doing
Document Page
2
OPERATING SYSTEM
the first. The process is usually some form of noticing size of chunk used, and copying it
to an earlier memory address, then grabbing the next chunk and repeating the process
until a large portion of memory have been moved into these adjacent processes. Then
marking the areas as used, and the areas copied from as available. The main disadvantage
is that the jobs would be having new addresses and also compaction is a technique that
would require a large amount of time and the system would be having a complicated
memory management system. The main advantage is that the process can move to a
straight forward position during the execution of the system and also the process can
grow very easily in the system.
Answer to question number 2
a.
TIME
10 3
11 16 3
15 8 16 3
50 1 8 16 3
85 18 1 8 16 3
100 4 18 1 8 16 3
105 15 4 18 1 8 16
120 12 15 4 18 1 8
The order in which the page will be replaced: 3, 16,8,1,18,4,15,12.
a. The LRU algorithm uses the status bits. It provides the information about the new entries
and the validation is also done by this bit.
The page replacement order is : 18,12,8,3,0,16,14,6.
Answer to question number 3
Document Page
3
OPERATING SYSTEM
a.
FCFS
SJN
SRT
Round Robin
b. Total time needed by a job to be completed is known as the turnaround time. The total
time that the jobs waits before getting executed is known as total waiting time.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
OPERATING SYSTEM
Document Page
5
OPERATING SYSTEM
Document Page
6
OPERATING SYSTEM
Bibliography
[1] Moraru, I., Andersen, D.G., Kaminsky, M., Tolia, N., Ranganathan, P. and Binkert, N,
November. Consistent, durable, and safe memory management for byte-addressable non volatile
main memory. In Proceedings of the First ACM SIGOPS Conference on Timely Results in
Operating Systems (p. 1). ACM., 2013.
[2] Sirohi, A., Pratap, A. and Aggarwal, M. Improvised Round Robin (CPU) Scheduling
Algorithm. International Journal of Computer Applications, 99(18), pp.40-43., 2014.
chevron_up_icon
1 out of 7
circle_padding
hide_on_mobile
zoom_out_icon