GATE - 2017 | OS | In a file allocation system, which of the following allocation scheme(s)

GATE - 2017 | OS | In a file allocation system, which of the following allocation scheme(s)
Posted on 09-02-2022

GATE - 2017 [Operating System]

Question:

In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?

  1. Contiguous
  2. Linked
  3. Indexed

A

I and III only

B

II only

C

III only

D

II and III only

  

Solution:

Option (D) is Correct

→ Contiguous Allocation:
Advantage:
i) Both sequential and direct access is possible.
ii) Extremely fast.
Disadvantage:
i) Suffers from both internal and external fragmentation.
ii) Increasing file size is difficult because it depends on the availability of contiguous memory at a particular instance.
→ Linked list allocation:
Advantage:
i) Flexible in terms of size.
ii) Does not suffer from external fragmentation.
Disadvantage:
i) Allocation is slower.
ii) Does not support random or direct access.
iii) Pointers require some extra overhead.
→ Indexed allocation:
Advantage:
i) Support direct access, so provides fast access to the file blocks.
ii) No external fragmentation.
Disadvantage:
i) The pointer overhead for indexed allocation is greater than linked allocation.
ii) Inefficient in terms of memory utilization.

------------------------------------------------------

Concept:

Internal fragmentation occurs when a process is allocated more memory than required, few spaces are left unused.

External fragmentation occurs when blocks of memory are there, but they are non-contiguous and can’t fill the upcoming request for memory.

Explanation:

Linked and indexed allocation are free from external fragmentation but contiguous allocation scheme suffered from external fragmentation problems.

Thank You