Tutorial Main Memory Management
Tutorial Main Memory Management
TUTORIAL
Memory Management
1. In each of the listed memory management schemes, briefly describe the functions performed by the
operating system:
The operating system is responsible for dividing the physical memory into multiple variable-sized
partitions. Each partition can accommodate a program or a process, and the size of the partition is not
fixed.
The operating system manages the mapping between logical pages and physical frames through a page
table. It handles page faults, allocates and deallocates pages in physical memory, performs page
replacement when necessary, enforces memory protection and manages fragmentation to optimize
memory usage.
2. In a fixed partition memory management, assume that Suppose at time Tn, the free partition list is as
follows:
Determine which partition will be assigned if the request for memory in the queue is as follows:
P1 - 12K
P2 - 10K
P3 - 18K
P4 - 15K
(a) First-fit
P1 (12K) will be assigned to the 20K partition
P2 (10K) will be assigned to the 10K partition
P3 (18K) will be assigned to the 20K partition
P4 (15K) will be assigned to the 20K partition
(b) Next-fit
P1 (12K) will be assigned to the 30K partition
P2 (10K) will be assigned to the 20K partition
P3 (18K) will be assigned to the 30K partition
P4 (15K) will be assigned to the 30K partition
(c) Best-fit
P1 (12K) will be assigned to the 20K partition
P2 (10K) will be assigned to the 10K partition
P3 (18K) will be assigned to the 20K partition
P4 (15K) will be assigned to the 20K partition
(d) Worst-fit
P1 (12K) will be assigned to the 40K partition
P2 (10K) will be assigned to the 40K partition
P3 (18K) will be assigned to the 40K partition
P4 (15K) will be assigned to the 40K partition
3. In a variable partition memory management, assume memory is allocated as specified in a diagram below:
Suppose the request for memory is as follows:
Redraw the diagram to show how memory would look after all requests has been allocated by using the
following memory allocation strategies:
P3 P1 P2
P1 P2 P3
P3 P1 P2
P1 P2 P3
It aligns well with the binary representation of addresses. This alignment simplifies the mapping of logical
addresses to physical addresses and vice versa.
5. What are the two major differences between segmentation and paging?
Segmentation Paging
Use variable-size addressing method Use fixed-length addressing method
Memory is divided into logical segments that Memory is divided into fixed-size sections known as
correspond to various components of a programme pages
6. On a system using simple segmentation, compute the physical address for each logical address stated
below, given the following segment table. If the address generates a segment fault, indicate so.
Segment Base Length/Limit
0 330 124
1 876 211
2 111 99
3 498 302