The Wayback Machine - https://web.archive.org/web/20240927185003/https://www.geeksforgeeks.org/resource-allocation-techniques-for-processes/
Open In App

Resource Allocation Techniques for Processes

Last Updated : 14 May, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The Operating System allocates resources when a program need them. When the program terminates, the resources are de-allocated, and allocated to other programs that need them. Now the question is, what strategy does the operating system use to allocate these resources to user programs? 

There are two Resource allocation techniques:

     1. Resource partitioning approach – In this approach, the operating system decides beforehand, that what resources should be allocated to which user program. It divides the resources in the system to many resource partitions, where each partition may include various resources – for example, 1 MB memory, disk blocks, and a printer. Then, it allocates one resource partition to each user program before the program’s initiation. A resource table records the resource partition and its current allocation status (Allocated or Free). 

          Advantages:

  • Easy to Implement
  • Less Overhead

          Disadvantages:

  • Lacks flexibility – if a resource partition contains more resources than what a particular process requires, the additional resources are wasted.
  • If a program needs more resources than a single resource partition, it cannot execute (Though free resources are present in other partitions).

           An Example Resource Table may look like this:-

 

           The above Resource Table is of the time of Booting. Resource Table is the core data structure that is used in the resource allocation techniques. Resource Table contains resource partitions as entries rather than single resources.

     2. Pool based approach – In this approach, there is a common pool of resources. The operating System checks the allocation status in the resource table whenever a program makes a request for a resource. If the resource is free, it allocates the resource to the program. 

          Advantages:

  • Allocated resources are not wasted.
  • Any resource requirement can be fulfilled if the resource is free (unlike Partitioning approach)

          Disadvantages:

  • Overhead of allocating and de-allocating the resources on every request and release.


Similar Reads

Buddy Memory Allocation Program | Set 1 (Allocation)
Prerequisite - Buddy System Question: Write a program to implement the buddy system of memory allocation in Operating Systems.Explanation - The buddy system is implemented as follows- A list of free nodes, of all the different possible powers of 2, is maintained at all times (So if total memory size is 1 MB, we'd have 20 free lists to track-one for
13 min read
Resource Allocation
To assign the available resources in an economic way is known as resource allocation. The planning of the activities and the resource required by these activities while taking into consideration both resources availability and project time is termed as resource allocation in project management. There are 2 parts of resource allocation: Strategic Pl
2 min read
Resource Allocation Graph (RAG) in Operating System
As Banker's algorithm using some kind of table like allocation, request, available all that thing to understand what is the state of the system. Similarly, if you want to understand the state of the system instead of using those table, actually tables are very easy to represent and understand it, but then still you could even represent the same inf
5 min read
Memory Allocation Techniques | Mapping Virtual Addresses to Physical Addresses
Prerequisite : Requirements of Memory Management System, Logical and Physical Address Memory Allocation Techniques:To store the data and to manage the processes, we need a large-sized memory and, at the same time, we need to access the data as fast as possible. But if we increase the size of memory, the access time will also increase and, as we kno
5 min read
First-Fit Allocation in Operating Systems
INTRODUCTION: First-Fit Allocation is a memory allocation technique used in operating systems to allocate memory to a process. In First-Fit, the operating system searches through the list of free blocks of memory, starting from the beginning of the list, until it finds a block that is large enough to accommodate the memory request from the process.
3 min read
Best-Fit Allocation in Operating System
INTRODUCTION: Best-Fit Allocation is a memory allocation technique used in operating systems to allocate memory to a process. In Best-Fit, the operating system searches through the list of free blocks of memory to find the block that is closest in size to the memory request from the process. Once a suitable block is found, the operating system spli
4 min read
Worst-Fit Allocation in Operating Systems
For both fixed and dynamic memory allocation schemes, the operating system must keep a list of each memory location noting which are free and which are busy. Then as new jobs come into the system, the free partitions must be allocated. These partitions may be allocated in 4 ways: 1. First-Fit Memory Allocation 2. Best-Fit Memory Allocation 3. Worst
2 min read
File Allocation Methods
The allocation methods define how the files are stored in the disk blocks. There are three main disk space or file allocation methods. Contiguous Allocation Linked Allocation Indexed Allocation The main idea behind these methods is to provide: Efficient disk space utilization. Fast access to the file blocks. All the three methods have their own adv
5 min read
Buddy System - Memory Allocation Technique
Static partition techniques are limited by having a fixed number of active processes, and space use may not be optimal. The buddy system is a memory allocation and management technique that uses power-of-two increments. Assume the memory size is 2U and a size of S is required. In this article, we are going to discuss the Buddy System in detail alon
8 min read
Partition Allocation Methods in Memory Management
In the operating system, the following are four common memory management techniques. Single contiguous allocation: Simplest allocation method used by MS-DOS. All memory (except some reserved for OS) is available to a process. Partitioned allocation: Memory is divided into different blocks or partitions. Each process is allocated according to the re
4 min read
Buddy Memory Allocation Program | Set 2 (Deallocation)
Prerequisite - Buddy Allocation | Set 1 Question: Write a program to implement the buddy system of memory allocation and deallocation in Operating Systems.Explanation - As we already know from Set 1, the allocation is done via the usage of free lists. Now, for deallocation, we will maintain an extra data structure-a Map (unordered_set in C++, HashM
15+ min read
Non-Contiguous Allocation in Operating System
Non-contiguous allocation, also known as dynamic or linked allocation, is a memory allocation technique used in operating systems to allocate memory to processes that do not require a contiguous block of memory. In this technique, each process is allocated a series of non-contiguous blocks of memory that can be located anywhere in the physical memo
6 min read
Difference Between Contiguous and Non-Contiguous Memory Allocation
Memory management is one of the fundamentals of operating systems that has implications for its performances and use of resources. These are discussed below: Contiguous and non-contiguous allocation of memory Allocation of memory may take either of the following forms: This article enables you to know the difference between the two, how memory is a
5 min read
Processes in Linux/Unix
A program/command when executed, a special instance is provided by the system to the process. This instance consists of all the services/resources that may be utilized by the process under execution. Whenever a command is issued in Unix/Linux, it creates/starts a new process. For example, pwd when issued which is used to list the current directory
6 min read
Reasons for Processes Termination
A process in an operating system can be terminated when certain errors or default conditions occur. Following are some of the reasons that lead to process termination, Reasons for Process Termination: Normal Completion: A process can complete its execution in a normal manner by executing an operating system service call. Unavailability of the Requi
3 min read
Concurrent Processes in Operating System
Concurrent processing is a computing model in which multiple processors execute instructions simultaneously for better performance. Concurrent means, which occurs when something else happens. The tasks are broken into subtypes, which are then assigned to different processors to perform simultaneously, sequentially instead, as they would have to be
2 min read
Find the order of execution of given N processes in Round Robin Scheduling
Given an array arr[] representing burst time of N processes scheduled using the Round Robin Algorithm with given quantum time Q. Assuming that all the process arrive at time t = 0, the task is to find the order in which the process execute. Examples: Input: arr[] = {3, 7, 4}, q = 3Output: 0 2 1Explanation:The order of execution is as follows P0, P1
12 min read
Find the time taken finish Processing of given processes
Given N processes and two arrays, arr1[] and arr2[] of size N each. arr1[] contains time spent by any process in critical section and arr2[] denotes time taken by a process to complete processing after coming out of the critical section. The task is to find the time taken by all the processes to complete their processing (both in critical section a
6 min read
Relation Between Number of Processes and Number of Resources to Prevent Deadlock
A set of blocked processes where each process is holding some resource and waiting to acquire some other resource held by another process in the set. This situation is called deadlock in the operating system. Deadlock can be prevented if the number of resource instances in a system is significantly larger than the number of processes asking for a r
3 min read
Program for FCFS CPU Scheduling | Set 2 (Processes with different arrival times)
We have already discussed FCFS Scheduling of processes with same arrival time. In this post, scenarios, when processes have different arrival times, are discussed. Given n processes with their burst times and arrival times, the task is to find the average waiting time and an average turn around time using FCFS scheduling algorithm. FIFO simply queu
15+ min read
Zombie Processes and their Prevention
Zombie state: When a process is created in UNIX using fork() system call, the parent process is cloned. If the parent process calls wait() system call, then the execution of the parent is suspended until the child is terminated. At the termination of the child, a 'SIGCHLD' signal is generated by the kernel which is delivered to the parent. Parent,
5 min read
Program to show that Linux provides time sharing environment to processes
Time-sharing means sharing of computing resources among many users (processes) by means of multiprogramming and multitasking. By allowing a large number of users to interact concurrently, time-sharing dramatically lowered the cost of providing computing capability. Many operating system including Windows, Linux and many others provides time-sharing
2 min read
Operations on Processes
Process operations refer to the actions or activities performed on processes in an operating system. These operations include creating, terminating, suspending, resuming, and communicating between processes. Operations on processes are crucial for managing and controlling the execution of programs in an operating system. Operations on processes are
5 min read
Difference between Zombie, Orphan and Daemon Processes
In computer, processes are fundamental units of execution of any program or task. Every process behaves differently after their primary tasks are completed or if their parent processes are terminated. Understanding the differences between zombie, orphan, and daemon processes is very important for system management and error handling. A zombie proce
5 min read
Get/Set process resource limits in C
The getrlimit() and setrlimit() system calls can be used to get and set the resource limits such as files, CPU, memory etc. associated with a process. Each resource has an associated soft and hard limit. soft limit: The soft limit is the actual limit enforced by the kernel for the corresponding resource. hard limit: The hard limit acts as a ceiling
3 min read
Drawback of Resource Preemption
We know that when the deadlock has occurred in the operating system, then for removing it we are going to preempt some process and give resources to others processes, so whenever the preemption is required to remove the deadlock, some drawbacks are arises as: Select the victim, Rollback of processes, and Starvation. Select the victim: First drawbac
2 min read
Resource Reservation Protocol in Real-time Systems
Resource Reservation Protocol (RSVP) is used in real-time systems for an efficient quality band transmission to a particular receiver. It is generally used by the receiver side for the fast delivery of the transmission packets from the sender to the receiver. Features of Resource Reservation Protocol: RSVP is receiver initiated. Receiver node in th
5 min read
What is Human Resource Management (HRM) ?
Human Resource : All employees or individuals engaged in any organizational activity, regardless of their level whether the employee is of the top level, or middle level, or at the starting level. It is also known as manpower and personnel. Human Resource Management (HRM) : It is a process of making effective and efficient use of human resources to
1 min read
Resource Acquisition Is Initialization
RAII stands for "Resource Acquisition Is Initialization". Suppose there is a “resource” in terms of Files, Memory, Sockets, etc. RAII means that an object’s creation and destruction are tied to a resource being acquired and released. Let's assume we have to write events to a log file. A non-object-oriented way to do this would be: C/C++ Code void W
9 min read
Resource Management in Operating System
Resource Management in Operating System is the process to manage all  the resources efficiently like CPU, memory, input/output devices, and other hardware resources among the various programs and processes running in the computer. Resource management is an important thing because resources of a computer are limited and multiple processes or users m
3 min read
Article Tags :
Practice Tags :