0% found this document useful (0 votes)
88 views2 pages

CST232 Tutorial2

This document discusses memory management techniques in operating systems including fixed and dynamic partitioning, first-fit and best-fit allocation schemes, internal and external fragmentation, and memory compaction. It provides examples of applying these concepts with figures showing memory configurations and jobs to load. Questions are asked about fitting jobs into memory using different allocation schemes, calculating wasted memory, accommodating a large job, the results of memory compaction, and relocation register contents before and after compaction.

Uploaded by

VortexProYeo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views2 pages

CST232 Tutorial2

This document discusses memory management techniques in operating systems including fixed and dynamic partitioning, first-fit and best-fit allocation schemes, internal and external fragmentation, and memory compaction. It provides examples of applying these concepts with figures showing memory configurations and jobs to load. Questions are asked about fitting jobs into memory using different allocation schemes, calculating wasted memory, accommodating a large job, the results of memory compaction, and relocation register contents before and after compaction.

Uploaded by

VortexProYeo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CST232 – Operating Systems

TUTORIAL 2

Answer all four (4) questions.

Chapter 2

1. Compare fixed and dynamic partitioning in memory management.

2. Assume a computer is using fixed partitions for its memory management. Current state of its
memory is shown in Figure 1a. Figure 1b shows the jobs that are waiting to be loaded into
memory.

Partition Status Size Job Size


A Free 30K J1 10K
J2 20K
B Free 15K J3 30K
J4 10K
C Free 50K
Figure 1b
D Free 20K

Figure 1a

a) If first-fit allocation scheme is used,


 show the state of memory after all jobs are loaded,
 calculate wasted memory (that cannot be allocated).

b) If best-fit allocation scheme is used,


 show the state of memory after all jobs are loaded,
 calculate wasted memory (that cannot be allocated).

3. Compare internal and external fragmentation in memory allocation schemes.

1
4. Assume we have the memory configuration as shown in Figure 2. At this point, Job 4 arrives
requesting a block of 100K.

a) Can Job 4 be accommodated? Explain.

b) What does the memory in Figure 2 looks like after


compaction?

c) Calculate the following.


Relocation register after compaction
Job 1
Job 2
Job 3

d) What are the contents of the relocation register for Job


4 after it has been loaded into memory? Figure 2

e) Calculate the following.


Original location of New location of same
certain instruction instruction in a job
in a job after compaction
Job 1 22K
Job 2 55K
Job 3 80K

----- The End -----

You might also like