retagged by
2,153 views
1 votes
1 votes

If file size is large and if it is to be accessed randomly then which of the following allocation strategy should be best to use in a system?

  1. Linked allocation
  2. Indexed allocation
  3. Contiguous allocation
  4. None of the options
retagged by

4 Answers

2 votes
2 votes

Option A

Contiguous:All blocks of a file are stored contiguously.
Advantages:

  • Faster access as all blocks are nearby.
  • Suitable for small sequentially accessed file

Disadvantages:

  • Poor performance if file grows or shrinks.
  • This method suffers from both internal and external fragmentation. This makes it inefficient in terms of memory utilization.
  • Increasing file size is difficult because it depends on the availability of contiguous memory at a particular instance.

 

Linked Allocation:Each block stores pointer to next block
Advantages:

  • No fragmentation
  • Suitable for large sequentially accessed file

Disadvantages:

  • Because the file blocks are distributed randomly on the disk, a large number of seeks are needed to access every block individually. This makes linked allocation slower.
  • Random access is not possible, If one link is lost, cannot access subsequent blocks.
  • Pointers required in the linked allocation incur some extra overhead.

 

Indexed Allocation:A single bock stores indexes of all blocks of a file.
Advantage:

  • Suitable for large randomly accessed file
  • It overcomes the problem of external fragmentation.

Disadvantages:

  • The pointer overhead for indexed allocation is greater than linked allocation.
  • For very small files, say files that expand only 2-3 blocks, the indexed allocation would keep one entire block (index block) for the pointers which is inefficient in terms of memory utilization. However, in linked allocation we lose the space of only 1 pointer per block.

 

https://www.tutorialspoint.com/operating_system/os_file_system.htm

https://www.geeksforgeeks.org/file-allocation-methods/

1 votes
1 votes

Opton (B) Indexed allocation is correct

As the file size is large, we cannot use Contiguous allocation, we also need random access and therefore Linked allocation is also not suitable. 

Answer:

Related questions

2 votes
2 votes
4 answers
1
admin asked Mar 31, 2020
17,314 views
Operating System maintains the page table for :each processeach threadeach instructioneach address
1 votes
1 votes
2 answers
2
admin asked Mar 31, 2020
2,478 views
Non-contiguous memory allocation splits program into blocks of memory called ________ that can be loaded in non-adjacent holes in main memory.PagesFramesPartitionSegments...
1 votes
1 votes
1 answer
3
admin asked Mar 31, 2020
1,615 views
What is Compaction ?a technique for overcoming internal fragmentationa paging techniquea technique for overcoming external fragmentationa technique for overcoming fatal e...
4 votes
4 votes
3 answers
4
admin asked Mar 31, 2020
2,252 views
Process is in a ready state _______ .when process is scheduled to run after some executionwhen process is unable to run until some task has been completedwhen process is ...