0 votes 0 votes Consider a file whose size varies between $4\: KB$ and $4\: MB$ during its lifetime. Which of the three allocation schemes (contiguous, linked and table/indexed) will be most appropriate? Operating System tanenbaum operating-system file-system memory-management descriptive + – admin asked Oct 27, 2019 admin 601 views answer comment Share Follow See 1 comment See all 1 1 comment reply `JEET commented Oct 29, 2019 reply Follow Share table/indexed? 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes Contagious Allocation – This is not a preferred method for allocation if the file size varies. It requires a contagious sequence of blocks large enough to handle the entire file. Since the size of the file specified in this question varies, either you have to pre-allocate 4 MB of space (which could result in wastage if the file size is minimum), or the file will need to be copied whenever it grows, to a contagious block of free space. Supports Random access. Linked Allocation – This is a preferred way for the above file if random access is not needed, rather sequential access is needed. This method does not require contagious blocks of free space, rather it will link new blocks whenever a new block is needed from the free blocks available. Does not support Random Access. Indexed Allocation – This is also a preferred way for the above file if random access is needed. A table called Index Table is used to store all the physical addresses of the data blocks of a file. Blocks can be added or removed as per needed. More complex than linked allocation. Overhead for storing the Index Table is huge (greater overhead than Linked Allocation). As the question does not specify if it requires a random access or not, Linked Allocation is the most appropriate answer considering the file is accessed sequentially. DebRC answered Jun 25, 2022 DebRC comment Share Follow See all 0 reply Please log in or register to add a comment.