Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

We use cookies to ensure you have the best browsing experience on our website.

By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy
Policy
Got it!

Login

COURSES HIRE WITH US


Skip to content


 Algo ▼
 DS ▼
 Languages ▼
 Interview ▼
 Students ▼
 GATE ▼
 CS Subjects ▼
 Quizzes ▼
 GBlog
 Puzzles
 Practice

 GATE CS 2020 Important Official Dates


 Difference between Process and Thread
 Difference between Virtual memory and Cache memory
 Difference between Primary and Candidate Key
 Difference between Super Key and Candidate Key
 Recovery from Deadlock in Operating System
 Difference between Schema and Database
 Cache Memory Design
 Difference between Normalization and Denormalization
 Last Minute Notes – Discrete Mathematics
 GATE CS 2020 Syllabus
 How I Handle GATE CS Preparation with College Studies
 Compiler Design | Recursive Descent Parser
 Second Normal Form (2NF)
 First Normal Form (1NF)
 Difference between Multiprocessing and Multithreading
 Third Normal Form (3NF)
 Differences between POP3 and IMAP
 Last Minute Notes Computer Organization
 Compiler Design | Peephole Optimization
 Boyce-Codd Normal Form (BCNF)
 Domain Relational Calculus in DBMS
 Mutual exclusion in distributed system
 Multilevel Paging in Operating System
 Difference between Strong and Weak Entity
 Compiler Design | Loop Optimization
 Collision-Free Protocols in Computer Network
 Differences between Computer Architecture and Computer Organization
 Differences between Pure and Slotted Aloha
 TCP and UDP in Transport Layer
perm_identity

Operating System | Allocation of frames


An important aspect of operating systems, virtual memory is implemented using demand
paging. Demand paging necessitates the development of a page-replacement algorithm and a
frame allocation algorithm. Frame allocation algorithms are used if you have multiple
processes; it helps decide how many frames to allocate to each process.
There are various constraints to the strategies for the allocation of frames:

 You cannot allocate more than the total number of available frames.
 At least a minimum number of frames should be allocated to each process. This
constraint is supported by two reasons. The first reason is, as less number of frames
are allocated, there is an increase in the page fault ratio, decreasing the performance
of the execution of the process. Secondly, there should be enough frames to hold all
the different pages that any single instruction can reference.

Frame allocation algorithms –


The two algorithms commonly used to allocate frames to a process are:

1. Equal allocation: In a system with x frames and y processes, each process gets equal
number of frames, i.e. x/y. For instance, if the system has 48 frames and 9 processes,
each process will get 5 frames. The three frames which are not allocated to any
process can be used as a free-frame buffer pool.
o Disadvantage: In systems with processes of varying sizes, it does not make
much sense to give each process equal frames. Allocation of a large number of
frames to a small process will eventually lead to the wastage of a large number
of allocated unused frames.
2. Proportional allocation: Frames are allocated to each process according to the
process size.
For a process pi of size si, the number of allocated frames is ai = (si/S)*m, where S is
the sum of the sizes of all the processes and m is the number of frames in the system.
For instance, in a system with 62 frames, if there is a process of 10KB and another
process of 127KB, then the first process will be allocated (10/137)*62 = 4 frames and
the other process will get (127/137)*62 = 57 frames.
o Advantage: All the processes share the available frames according to their
needs, rather than equally.

Global vs Local Allocation –


The number of frames allocated to a process can also dynamically change depending on
whether you have used global replacement or local replacement for replacing pages in case
of a page fault.

1. Local replacement: When a process needs a page which is not in the memory, it can
bring in the new page and allocate it a frame from its own set of allocated frames
only.
o Advantage: The pages in memory for a particular process and the page fault
ratio is affected by the paging behavior of only that process.
o Disadvantage: A low priority process may hinder a high priority process by
not making available to the high priority process its frames.
2. Global replacement: When a process needs a page which is not in the memory, it can
bring in the new page and allocate it a frame from the set of all frames, even if that
frame is currently allocated to some other process; that is, one process can take a
frame from another.
o Advantage: Does not hinder the performance of processes and hence results
in greater system throughput.
o Disadvantage: The page fault ratio of a process can not be solely controlled
by the process itself. The pages in memory for a process depends on the
paging behavior of other processes as well.

Recommended Posts:
 Non-Contiguous Allocation in Operating System
 Resource Allocation Graph (RAG) in Operating System
 Buddy System - Memory allocation technique
 System Protection in Operating System
 Segmentation in Operating System
 The Tempo Operating System
 Multithreading in Operating System
 Functions of Operating System
 Introduction of Operating System - Set 1
 Kernel I/O Subsystem in Operating System
 Banker's Algorithm in Operating System
 Structures of Directory in Operating System
 Recovery from Deadlock in Operating System
 Benefits of Multithreading in Operating System
 Threads and its types in Operating System
aganjali10
Check out this Author's contributed articles.
If you like GeeksforGeeks and would like to contribute, you can also write an article using
contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your
article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article"
button below.

Article Tags :
GATE CS
Operating Systems Questions

thumb_up
3

Based on 1 vote(s)
Please write to us at contribute@geeksforgeeks.org to report any issue with the above
content.
Post navigation
Previous
first_page Open shortest path first (OSPF) router roles and configuration
Next
last_page Classes of Routing Protocols

Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link
here.
Most popular in GATE CS

 Construct a DFA which accept the language L = {w | w ∈ {a,b}* and Na(w) mod 3 =
Nb (w) mod 3}
 Difference between DDL and DML in DBMS
 Difference between Stop and Wait protocol and Sliding Window protocol
 Difference between Stateless and Stateful Protocol
 Difference between Private key and Public key

Most visited in Operating Systems Questions


 Introduction and Installation of Git
 Network File System (NFS)
 File System Inconsistency

 5th Floor, A-118,


 Sector-136, Noida, Uttar Pradesh - 201305
 feedback@geeksforgeeks.org

 COMPANY
 About Us
 Careers
 Privacy Policy
 Contact Us

 LEARN
 Algorithms
 Data Structures
 Languages
 CS Subjects
 Video Tutorials

 PRACTICE
 Courses
 Company-wise
 Topic-wise
 How to begin?

 CONTRIBUTE
 Write an Article
 Write Interview Experience
 Internships
 Videos

@geeksforgeeks, Some rights reserved


sramamamamamamamSaidulu

You might also like