×

Free Space Management in Operating System

What is Free Space Management?

The system always keeps the records of the free disks blocks for allocating space to files when they are created. To use the space free from removing the files, free space management becomes critical. The system maintains a free space list which keeps record of the disk blocks that are not assigned to some file or directory.

Free Space Management in Operating System

When file is created, operating system searches the free space register for saving the file. During deletion the file, the computer system frees the given space and attaches this to the “free space list”.

There are four methods used in the free space management of operating system. There are as follows:

  1. Bitmap or Bit vector
  2. Linked list
  3. Grouping
  4. Counting

Bitmap or Bit vector

A bitmap is a group of bits where each bit corresponds to a disk block. It can take two values: 0 and 1, where 0 indicates that the block is allocated and 1 indicates the free block. This is the most common method used to implement the free space list. In this method, each block in the hard disk is implemented by a bit.

Advantages of Bit vector

Advantages of bit vector are as follows:

  1. It is simple and easy to understand.
  2. It consumes less memory.
  3. It is well organized to find free space.

Disadvantages of Bit vector

Disadvantages of bit vector are as follows:

  1. OS goes through the all blocks unless it finds a free block.
  2. To find a free block, OS may need to search the entire bit vector.
  3. It requires a special hardware support in some conditions.

Linked list

In this method, the free disk blocks are attached together. A free block carries a pointer to the next free block. The block number of the very first disk block is collected at a separate location on disk and also cached in memory. This method has a major disadvantage that it requires for free space list traversal. This entire process is known as linked list.

Advantages of linked list

Advantages of linked list are as follows:

  1. In this method, accessible space is used effectively.
  2. As there is no size limit on a linked list, new space can be allocated easily.

Disadvantages of linked list

Disadvantages of linked list are as follows:

  1. In this method, the overhead of maintaining the pointer appears.
  2. The linked list is not efficient when we need to reach each block of the memory.

Grouping

This is also an important method for free space management. In this method, there is a modification of free list takes place which stores the address of the n free blocks. In grouping, the initial n-1 blocks are free but the last block carries the address of n blocks. When we use the standard linked list, the address of the higher number of blocks can be found very quickly. In grouping, we cannot keep a list of n free disk addresses but we keep address the initial free block. This whole process is known as grouping.

Advantages of grouping

Advantages of grouping are as follows:

  1. The address of higher number of free blocks can be found very quickly.
  2. Grouping is a type of method which has a benefit of making it simple to locate the addresses of collection of empty disk blocks.
  3. The modification of free list takes place that’s why there is no need to pass over the whole list.

Disadvantages of grouping

Disadvantages of grouping are as follows:

  1. The major disadvantage of grouping method is that the space of block is wasted in storing addresses. Nth block is used to collect the addresses of next free blocks.
  2. Addresses of initial free blocks can be saved but we are not able to maintain the list of all n free disk addresses.
  3.  It is very costly in maintaining the index of blocks.

Counting

Here, counting is the last method of free space management in operating system. This method is also used in the modification of the linked list method. This method has an advantage most of contiguous blocks can be freed concurrently. In this type of method linked list is maintained as well as the pointer to the next free block that come after first block is also preserved. There is no need to traverse the whole list. This whole process is known as counting.

Advantages of counting

Advantages of counting are as follows:

  1. Fast allocation of higher number of consecutive free blocks.
  2. Random access to the free block can be performed.
  3. Entire list is generally smaller in size.

Disadvantages of counting

Disadvantages of counting are as follows:

  1. Every free block requires huge space to keep the count in the disk.
  2. To perform traversal operations, we have to store the entries in B-tree.
  3. Whole area got reduced in counting.

Related Topics

Ubuntu Operating System

Ubuntu Operating System Ubuntu is an open-source and a Linux based operating system. Ubuntu is developed for the Network Servers, Computers, and Smartphones. The Ubuntu operating system was developed by Canonical...

3 minutes read.

Advantages of Operating System

What is an Operating System?   An operating system is an interface that helps to communicate with the user and the computer hardware. Operating systems are used for file management, memory...

3 minutes read.

Difference between Process and Program in the Operating System

What is a process in the Operating System? A process is a program that is going through the execution. It also helps us to execute all the lines of code in...

4 minutes read.

DOS Operating System

What is DOS Operating System? An operating system that runs from a hard disk drive is known as the DOS (Disk Operating System).In other words, DOS (Disk Operating System) is defined...

7 minutes read.

Turn Variable or Strict Alternative Approach

Turn Variable or Strict Alternative Approach Turn Variable Approach is used for process synchronization mechanism, which offers synchronization between two processes. Turn variable is implemented on user mode, and it is a software mechanism. We...

3 minutes read.

SCAN Disk Scheduling Algorithm

SCAN Disk Scheduling Algorithm The SCAN disk scheduling algorithm is another type of disk scheduling algorithm. In this algorithm, we move the disk arm into a specific direction (direction can be moved towards...

4 minutes read.

HRRN Scheduling in OS

Highest Response Ratio Next (HRRN) Scheduling in OS Highest Response Ratio Next Scheduling is a Non-Preemptive Scheduling algorithm. This algorithm provides the benefits of the shortest job first scheduling algorithm and also removes...

6 minutes read.

Evolution of Operating System

Evolution of Operating System The evolution of various types of operating systems can be briefly described as follows: Serial Processing Since 1950, the operating system started to be in use. Before 1950, there...

5 minutes read.

Scheduling Algorithms in OS

There are various types of scheduling algorithm which are used by the operating system to schedule the process on the processor. Objective of Scheduling Algorithms There are the following objectives of Scheduling Algorithms: Fare allocation...

2 minutes read.

How to implement Monitors using Semaphores

Monitors Monitor is a type of synchronization device designed to solve difficulties caused by semaphores, such as timing errors. Monitors are the type of data types that are abstract by nature...

2 minutes read.

Unix Operating System

Unix Operating System Unix Operating System is a multiuser, portable, time-sharing, and multitasking operating system that was developed in 1969. Unix operating system was developed by a group of AT &...

3 minutes read.

What is Deadlock in OS?

Deadlock in Operating System In an Operating System, a process uses various resources, and the resources are used in the following manner: Request the ResourceUse the ResourceRelease the Resource In the Operating System, Deadlock is a condition...

4 minutes read.

Look Disk Scheduling

Look Disk Scheduling Look disk scheduling is another type of disk scheduling algorithm. Look scheduling is an enhanced version of SCAN disk scheduling. Look disk scheduling is the same as SCAN disk scheduling,...

4 minutes read.

Segmentation in Operating System

The term segmentation in operating system refers to the division of computer memory into segments. Segmentation is a technique used by many modern operating systems to provide better memory management....

4 minutes read.

Need of Operating System

There are various needs of operating system: Managing Input-Output UnitThe Operating system as a platform for application programsMultitaskingConsistent user interface Managing Input-Output Unit: - With the help of the operating system, the...

2 minutes read.

SJF Scheduling in OS

Shortest Job First (SJF) Scheduling in OS Shortest Job First is a Preemptive or Non-Preemptive algorithm. In the shortest job first algorithm, the job having shortest or less burst time will...

4 minutes read.

Process Synchronization | Operating System

Process Synchronization Process Synchronization means managing the process in such a manner so that no two processes have access to share similar data and resources. We can use Process Synchronization in a Multi-Process System...

4 minutes read.

File Allocation Methods in Operating System

A file allocation method is a way that an operating system stores and retrieves files on a storage device, such as a hard drive or SSD. The file allocation method...

4 minutes read.

Difference between Rotational Latency and Disk Assess Time in Disk Scheduling

Disk scheduling is used by operating systems to arrange the arrival of I/O requests to the disc. Disk scheduling is necessary because several I/O requests may occur from various processes,...

4 minutes read.

Strategies for Handling Deadlock

Strategies for Handling Deadlock The Strategies for handling Deadlock are: Deadlock IgnoranceDeadlock PreventionDeadlock AvoidanceDeadlock Detection and Recovery Deadlock Ignorance Deadlock Ignorance is the most popular deadlock handling strategy. We can use this in the various operating systems for...

2 minutes read.