Operating Systems Concepts - Engineering

Q1:

Fragmentation of the file system

A occurs only if the file system is used improperly

B can always be prevented

C can be temporarily removed by compaction

D is a characteristic of all file systems

E None of the above

ANS:C - can be temporarily removed by compaction

Defragmentation means storing the complete file in a smallest number of contiguous regions. That is, it tries to stores a file as one complete unit if that size of contiguous memory is available. Suppose process A has fragments A1, A2, A3, process B has fragments B1, B2.

Now, suppose memory layout is |A1|B1|A2|A3|B2|, after defragmentation we have |A1|A2|A3|B1|B2|.

Defragmentation can also contribute to compaction.