Download as pdf or txt
Download as pdf or txt
You are on page 1of 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