OS-Allocatong and Freeing Space

When files are allocated and freed it is common for the space on disk to become increasingly fragmented. One technique for alleviating this problem is to perform periodic compaction or garbage collection. Files may be reorganized to occupy adjacent areas of the disk, and free areas may be collected into a single block or a group of large blocks. This garbage collection is often done during the system shut down; some systems perform compaction dynamically while in operation. A system may choose to reorganize the files of users not currently logged in, or it may reorganize files that have not been referenced for a long time.

Designing a file system requires knowledge of the user community, including the number of users, the average number and size of files per user, the average duration of user sessions, the nature of application to be run on the system, and the like. Users searching a file for information often use file scan options to locate the next record or the previous record.

In a paged systems, the smallest amount of information transferred between secondary and primary storage is a page, so it makes sense to allocate secondary storage in blocks of the page size or a multiple of a page size.

Locality tells us tat once a process has referred to a data item on a page it is likely to reference additional data items on that page; it is also likely to reference data items on pages contiguous to that page in the user’s virtual address space.
Share this article :
Copyright © 2012. Best Online Tutorials | Source codes | Programming Languages - All Rights Reserved