Q1. Consider a memory of size 16KB. This memory is allocated in increments of 1KB and the memory is initially empty. Use the various contiguous allocation schemes (First-fit, Best-fit, and Worst-fit) for satisfying the memory allocation/deallocation requests for processes requesting the sizes shown in the table below. Process Requested size (in KB) A B C D E F G H I J 4.2 7.2 2.5 4.5 3 2.7 1.5 2 3.6 1 Allocate(P) represents an allocation request by process P for the size shown in the above table Deallocate(P) is used to indicate deallocating the memory allocated to process P To represent memory, in square brackets, we use P to indicate a memory segment allocated to P and we use an integer to indicate a contiguous free part of memory. For example, after the following sequence of requests: Allocate(B), Allocate(G), Allocate(H), Deallocate(G) memory will look like this: B 8KB We represent this memory by [B,2,H,4]. free H free 2KB 2KB 4KB For each of the following sequence of requests, apply the First-fit, Best-fit, and Worst-fit allocation schemes. Assume that for each algorithm, you always start at the beginning of the list and if there are multiple possible equal-size holes that can be selected by an algorithm, the first one is selected. Show the following: i. If all the requests can be satisfied, indicate the memory representation at the end of the sequence. If a request cannot be satisfied by an algorithm, indicate which request is this and the memory representation at this point. For example, consider adding the request Allocate(X) to the previous example. The following are answer examples If X is requesting 6 KB the answer will be: [B,2,H,4] and Allocate(X) cannot be satisfied If X is requesting 3 KB, the answer will be [B,2,H,X,1] ii. Which method is the best for this particular sequence, and the amount (in KB) of internal fragmentation at the end of the sequence for this best method. Enter your answers in the tables below. 1 a) Request Sequence: Allocate(A), Allocate (B), Allocate (C), Deallocate (A), Deallocate (C), Allocate (E), Allocate(D) First-fit Worst-fit Best-fit The best algorithm for this sequence of requests is: The amount of internal fragmentation (in KB) for this algorithm is

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Q1. Consider a memory of size 16KB. This memory is allocated in increments of 1KB and the
memory is initially empty. Use the various contiguous allocation schemes (First-fit, Best-fit,
and Worst-fit) for satisfying the memory allocation/deallocation requests for processes
requesting the sizes shown in the table below.
Process
Requested size (in
KB)
A
4.2
B
C
7.2 2.5
D
G
H
J
E F
I
4.5 3 2.7 1.5 2 3.6 1
Allocate(P) represents an allocation request by process P for the size shown in the above table
Deallocate (P) is used to indicate deallocating the memory allocated to process P
To represent memory, in square brackets, we use P to indicate a memory segment allocated
to P and we use an integer to indicate a contiguous free part of memory. For example, after
the following sequence of requests: Allocate(B), Allocate(G), Allocate (H), Deallocate(G)
memory will look like this:
B
8KB
We represent this memory by [B,2,H,4].
free H
free
2KB 2KB 4KB
For each of the following sequence of requests, apply the First-fit, Best-fit, and Worst-fit
allocation schemes. Assume that for each algorithm, you always start at the beginning of the
list and if there are multiple possible equal-size holes that can be selected by an algorithm,
the first one is selected. Show the following:
i. If all the requests can be satisfied, indicate the memory representation at the end of
the sequence. If a request cannot be satisfied by an algorithm, indicate which request
is this and the memory representation at this point. For example, consider adding the
request Allocate(X) to the previous example. The following are answer examples
If X is requesting 6 KB the answer will be:
[B,2,H,4] and Allocate(X) cannot be satisfied
If X is requesting 3 KB, the answer will be
[B,2,H,X,1]
ii. Which method is the best for this particular sequence, and the amount (in KB) of
internal fragmentation at the end of the sequence for this best method.
Enter your answers in the tables below.
7
Request Sequence: Allocate(A), Allocate (B), Allocate (C), Deallocate (A), Deallocate(C),
Allocate (E), Allocate(D)
First-fit
Best-fit
The best algorithm for this sequence of requests is:.
The amount of internal fragmentation (in KB) for this algorithm is
Worst-fit
Transcribed Image Text:Q1. Consider a memory of size 16KB. This memory is allocated in increments of 1KB and the memory is initially empty. Use the various contiguous allocation schemes (First-fit, Best-fit, and Worst-fit) for satisfying the memory allocation/deallocation requests for processes requesting the sizes shown in the table below. Process Requested size (in KB) A 4.2 B C 7.2 2.5 D G H J E F I 4.5 3 2.7 1.5 2 3.6 1 Allocate(P) represents an allocation request by process P for the size shown in the above table Deallocate (P) is used to indicate deallocating the memory allocated to process P To represent memory, in square brackets, we use P to indicate a memory segment allocated to P and we use an integer to indicate a contiguous free part of memory. For example, after the following sequence of requests: Allocate(B), Allocate(G), Allocate (H), Deallocate(G) memory will look like this: B 8KB We represent this memory by [B,2,H,4]. free H free 2KB 2KB 4KB For each of the following sequence of requests, apply the First-fit, Best-fit, and Worst-fit allocation schemes. Assume that for each algorithm, you always start at the beginning of the list and if there are multiple possible equal-size holes that can be selected by an algorithm, the first one is selected. Show the following: i. If all the requests can be satisfied, indicate the memory representation at the end of the sequence. If a request cannot be satisfied by an algorithm, indicate which request is this and the memory representation at this point. For example, consider adding the request Allocate(X) to the previous example. The following are answer examples If X is requesting 6 KB the answer will be: [B,2,H,4] and Allocate(X) cannot be satisfied If X is requesting 3 KB, the answer will be [B,2,H,X,1] ii. Which method is the best for this particular sequence, and the amount (in KB) of internal fragmentation at the end of the sequence for this best method. Enter your answers in the tables below. 7 Request Sequence: Allocate(A), Allocate (B), Allocate (C), Deallocate (A), Deallocate(C), Allocate (E), Allocate(D) First-fit Best-fit The best algorithm for this sequence of requests is:. The amount of internal fragmentation (in KB) for this algorithm is Worst-fit
Expert Solution
steps

Step by step

Solved in 6 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY