SlideShare a Scribd company logo
1 of 30
Download to read offline
Introduction
to
Operating Systems – 3
Memory Management
PROF. K. ADISESHA
Introduction
to
Operating System
Memory Concepts
Memory Allocation
Memory Partitions
Paging
Virtual Memory
2
Memory Management
Introduction
Prof. K. Adisesha (Ph. D)
3
Memory Hierarchy Design:
In the Computer System Design, Memory Hierarchy is an enhancement to organize the
memory such that it can minimize the access time.
➢The Memory Hierarchy was developed based on a program behavior known as locality of
references.
➢This Memory Hierarchy Design is divided into 2 main types:
❖External Memory or Secondary Memory: Comprising of Magnetic Disk, Optical Disk,
Magnetic Tape i.e. peripheral storage devices which are accessible by the processor via I/O
Module.
❖Internal Memory or Primary Memory: Comprising of Main Memory, Cache Memory &
CPU registers. This is directly accessible by the processor.
➢,
Introduction
Prof. K. Adisesha (Ph. D)
4
Memory Management:
Memory management is the functionality of an operating system which handles or
manages primary memory and moves processes back and forth between main memory
and disk during execution.
➢Main Memory refers to a physical memory that is the internal memory to the computer.
➢Memory management keeps track of each and every memory location, regardless of
either it is allocated to some process or it is free.
➢It checks how much memory is to be allocated to processes.
➢It decides which process will get memory at what time.
➢It tracks whenever some memory gets freed or unallocated and correspondingly it
updates the status.
Introduction
Prof. K. Adisesha (Ph. D)
5
Process Address Space:
The process address space is the set of logical addresses that a process references in its
code.
➢ The operating system takes care of mapping the logical addresses to physical addresses at the
time of memory allocation to the program.
➢ There are three types of addresses used in a program before and after memory is allocated .
❖Symbolic addresses: The addresses used in a source code. The variable names, constants, and
instruction labels are the basic elements of the symbolic address space.
❖Relative addresses: At the time of compilation, a compiler converts symbolic addresses into relative
addresses.
❖Physical addresses: The loader generates these addresses at the time when a program is loaded into
main memory.
Memory Loading
Prof. K. Adisesha (Ph. D)
6
Memory Loading:
All the programs are loaded in the main memory for execution. Sometimes complete
program is loaded into the memory, but some times a certain part or routine of the
program is loaded into the main memory only when it is called by the program.
➢ There are two types of Loading techniques:
❖ Static Loading: The absolute program (and data) is loaded into memory in order
for execution to start.
❖ Dynamic Loading: dynamic routines of the library are stored on a disk in
relocatable form and are loaded into memory only when they are needed by the
program.
Memory Loading
Prof. K. Adisesha (Ph. D)
7
Swapping:
Swapping is the process of bringing in each process in main memory, running it for a
while and then putting it back to the disk.
➢ Swapping is also known as a technique for memory compaction.
➢ sometimes there is not enough main memory to hold all the currently active processes
in a timesharing system.
➢ The total time taken by swapping process includes the time it takes to move the entire
process to a secondary disk and then to copy the process back to memory, as well as
the time the process takes to regain main memory.
Memory Allocation
Prof. K. Adisesha (Ph. D)
8
Memory Allocation:
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 requirement.
➢ Paged memory management: Memory is divided into fixed-sized units called page
frames, used in a virtual memory environment.
➢ Segmented memory management: Memory is divided into different segments. In this
management, allocated memory doesn’t have to be contiguous.
Memory Allocation
Prof. K. Adisesha (Ph. D)
9
Partition Allocation :
In Partition Allocation, when there is more than one partition freely available to
accommodate a process’s request, a partition must be selected.
➢To choose a particular partition, a partition allocation method is needed.
➢When it is time to load a process into the main memory and if there is more than one
free block of memory of sufficient size then the OS decides which free block to allocate.
➢There are different Placement Algorithm:
❖First Fit: The first hole that is big enough is allocated to program.
❖Best Fit: The smallest hole that is big enough is allocated to program.
❖Worst Fit: The largest hole that is big enough is allocated to program.
Memory Allocation
Prof. K. Adisesha (Ph. D)
10
Memory Partitions :
Memory allocation is a process by which computer programs are assigned memory or
space.
➢Main memory usually has two partitions −
❖Low Memory − Operating system resides in this memory.
❖High Memory − User processes are held in high memory.
➢Operating system uses the following memory allocation mechanism.
➢Memory Partitioning types are:
❖Fixed / Static-partition allocation
❖Dynamic/ Multiple-partition allocation
Memory Allocation
Prof. K. Adisesha (Ph. D)
11
Dynamic Memory Partitioning:
In this technique, the partition size is not declared initially. It is declared at the time of
process loading
➢ The first partition is reserved for the operating system.
➢ The remaining space is divided into parts.
➢ The size of each partition will be equal to the size of the
process.
➢ The partition size varies according to the need of the
process so that the internal fragmentation can be avoided
Memory Allocation
Prof. K. Adisesha (Ph. D)
12
Fixed / Contiguous Memory Partitions :
In this type of allocation, main memory is divided into a number of fixed-sized
partitions where each partition should contain only one process.
➢ In this technique, the main memory is divided into partitions of equal or different sizes.
➢ The operating system always resides in the first partition while the other partitions can be used
to store user processes.
➢ The memory is assigned to the processes in contiguous way.
➢ The partitions cannot overlap.
➢ A process must be contiguously present in a partition for the execution
Memory Allocation
Prof. K. Adisesha (Ph. D)
13
Fragmentation:
Fragmentation is an unwanted problem where the memory blocks cannot be allocated
to the processes due to their small size and the blocks remain unused.
➢ The process with the size greater than the size of the largest partition could not be
executed due to the lack of sufficient contiguous memory blocks cannot be allocated to
new upcoming processes and results in inefficient use of memory.
➢ Basically, there are two types of fragmentation:
❖Internal Fragmentation
❖External Fragmentation
Memory Allocation
Prof. K. Adisesha (Ph. D)
14
Internal Fragmentation:
Memory block assigned to process is bigger. Some portion of memory is left unused, as
it cannot be used by another process.
➢ In this fragmentation, the process is allocated a memory block of size more than the size of
that process.
➢ Due to this some part of the memory is left unused and this cause internal fragmentation.
Memory Allocation
Prof. K. Adisesha (Ph. D)
15
External Fragmentation:
Total memory space is enough to satisfy a request or to reside a process in it, but it is
not contiguous, so it cannot be used.
➢ In this fragmentation, although we have total space
available that is needed by a process still we are not
able to put that process in the memory because that
space is not contiguous.
➢ After some time P1 and P3 got completed and their
assigned space is freed, but they cannot be used to
load a 2 MB process in the memory since they are
not contiguously located
Memory Allocation
Prof. K. Adisesha (Ph. D)
16
Compaction:
Compaction technique can be used to create more free memory out of fragmented
memory.
➢External fragmentation can be reduced by compaction or shuffle memory contents to
place all free memory together in one large block. To make compaction feasible, relocation
should be dynamic.
➢The internal fragmentation can be reduced by effectively assigning the smallest partition
but large enough for the process.
Memory Allocation
Prof. K. Adisesha (Ph. D)
17
Paging:
Pages of the process are brought into the main memory only when they are required
otherwise they reside in the secondary storage.
➢ Considering the fact that the pages are mapped to the frames in Paging, page size needs
to be as same as frame size.
➢ Different operating system defines different frame sizes.
➢ The pages belonging to a certain process are loaded into available.
➢ The sizes of each frame must be equal.
➢ Pages size is power of 2, between 512 bytes and 8192 bytes.
➢ The size of the process is measured in the number of pages..
Memory Allocation
Prof. K. Adisesha (Ph. D)
18
Paging:
Address Translation.
➢ Page address is called logical address and represented by page number and the offset.
❖ Logical Address = Page number + page offset
➢ Frame address is called physical address and represented by a frame number and
the offset.
❖ Physical Address = Frame number + page offset
➢ A data structure called page map table is used to keep track of the relation between a
page of a process to a frame in physical memory.
Memory Allocation
Prof. K. Adisesha (Ph. D)
19
Paging Faults:
A page fault occurs when a program attempts to access a block of memory that is not
stored in the physical memory, or RAM.
➢ The fault notifies the operating system that it must locate the data in virtual memory,
then transfer it from the storage device to the system RAM.
➢ Page fault arise the exception, that specifies the O/S, which access the memory slots
from virtual memory for running the program in continue nature.
Virtual memory
Prof. K. Adisesha (Ph. D)
20
Definition:
Virtual memory is a feature of an operating system that enables a computer to be able to
compensate shortages of physical memory by transferring pages of data from random
access memory to disk storage.
➢ Virtual memory is a memory management technique where secondary memory can be
used as if it were a part of the main memory
➢ Virtual memory serves two purposes.
❖ It allows us to extend the use of physical memory.
❖ It allows us to have memory protection, because each
virtual address is translated to a physical address.
Virtual memory
Prof. K. Adisesha (Ph. D)
21
Virtual memory:
Virtual memory allows a computer to treat secondary memory as though it were the main
memory.
➢ Virtual memory uses hardware and software to allow a computer to compensate for
physical memory shortages.
➢ Memory manager is in charge of keeping track of the shifts between physical and virtual
memory.
➢ Types of virtual memory are:
❖ Demand Paging
❖ Segmentation
Virtual memory
Prof. K. Adisesha (Ph. D)
22
Demand Paging:
A demand paging system is quite similar to a paging system with swapping where
processes reside in secondary memory and pages are loaded only on demand, not in
advance.
➢ Types of Page Replacement Methods are:
❖ FIFO
❖ Optimal Algorithm
❖ LRU Page Replacement
Virtual memory
Prof. K. Adisesha (Ph. D)
23
FIFO Page Replacement:
FIFO (First-in-first-out) is a simple implementation method, the process selects the page
for a replacement that has been in the virtual address of the memory for the longest time.
➢ Features of FIFO Page Replacement Methods are:
❖ Whenever a new page loaded, the page recently comes in the memory is removed.
❖ The oldest page in the main memory is one that should be selected for replacement
first
Virtual memory
Prof. K. Adisesha (Ph. D)
24
Optimal Algorithm:
The optimal page replacement method selects that page for a replacement for which the
time to the next reference is the longest.
➢ Features of Optimal algorithm are:
❖ Optimal algorithm results in the fewest number of page faults. This algorithm is
difficult to implement.
❖ Replace the page which unlike to use for a longer period of time. It only uses the
time when a page needs to be used.
Virtual memory
Prof. K. Adisesha (Ph. D)
25
LRU Page Replacement:
Least Recently Used (LRU) page, this method helps OS to find page usage over a short
period of time.
➢ This algorithm should be implemented by associating a counter with an even- page.
➢ Features of LRU Page Replacement are:
❖ The LRU replacement method has the highest count. This counter is also called
aging registers, which specify their age and how much their associated pages should
also be referenced.
❖ The page which hasn't been used for the longest time in the main memory is the one
that should be selected for replacement.
❖ It also keeps a list and replaces pages by looking back into time
Virtual memory
Prof. K. Adisesha (Ph. D)
26
Virtual memory:
Virtual memory is important for improving system performance, multitasking, using
large programs and flexibility.
➢ Benefits of using virtual memory
❖ Frees applications from managing shared memory and saves users from having to
add memory modules when RAM space runs out.
❖ Increased security because of memory isolation.
❖ Multiple larger applications can be run simultaneously.
❖ Doesn't need external fragmentation.
❖ Effective CPU use.
❖ Data can be moved automatically.
Operating System - Properties
Prof. K. Adisesha (Ph. D)
27
Distributed Environment:
A distributed environment refers to multiple independent CPUs or processors in a
computer system.
➢ An operating system does the following activities related to distributed environment:
❖ The OS distributes computation logics among several physical processors.
❖ The processors do not share memory or a clock. Instead, each processor has its own local
memory.
❖ The OS manages the communications between the processors.
❖ They communicate with each other through various communication lines.
Operating System - Properties
Prof. K. Adisesha (Ph. D)
28
Spooling:
Spooling is an acronym for simultaneous peripheral operations on line.
➢ Spooling refers to putting data of various I/O jobs in a buffer.
➢ This buffer is a special area in memory or hard disk which is accessible to I/O devices.
➢ Advantages
❖ The spooling operation uses a disk as a very large
buffer.
❖ Spooling is capable of overlapping I/O operation for
one job with processor operations for another job.
Operating System - Properties
Prof. K. Adisesha (Ph. D)
29
Spooling:
Spooling is an acronym for simultaneous peripheral operations on line.
➢ Spooling refers to putting data of various I/O jobs in a buffer.
➢ An operating system does the following activities related to distributed environment .
❖ Handles I/O device data spooling as devices have different data access rates.
❖ Maintains the spooling buffer which provides a waiting station where data can rest while the
slower device catches up.
❖ Maintains parallel computation because of spooling process as a computer can perform I/O
in parallel fashion.
❖ It becomes possible to have the computer read data from a tape, write data to disk and to
write out to a tape printer while it is doing its computing task
Discussion
Prof. K. Adisesha (Ph. D)
30
Queries ?
Prof. K. Adisesha
9449081542

More Related Content

What's hot

OS - Ch2
OS - Ch2OS - Ch2
OS - Ch2sphs
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xpMohd Tousif
 
Bba203 unit 2 operating system concepts
Bba203   unit 2 operating system conceptsBba203   unit 2 operating system concepts
Bba203 unit 2 operating system conceptskinjal patel
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case studyLavanya G
 
Storage management
Storage managementStorage management
Storage managementAtul Sharma
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory managementMukesh Chinta
 
Operating System a Case Study
Operating System a Case StudyOperating System a Case Study
Operating System a Case Studyijtsrd
 
Lecture 3,4 operating systems
Lecture 3,4   operating systemsLecture 3,4   operating systems
Lecture 3,4 operating systemsPradeep Kumar TS
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementAjit Nayak
 
Operating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management ConceptsOperating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management ConceptsPeter Tröger
 

What's hot (20)

Chapter 22 - Windows XP
Chapter 22 - Windows XPChapter 22 - Windows XP
Chapter 22 - Windows XP
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
OS - Ch2
OS - Ch2OS - Ch2
OS - Ch2
 
Storage Structure in OS
Storage Structure in OSStorage Structure in OS
Storage Structure in OS
 
OSCh21
OSCh21OSCh21
OSCh21
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xp
 
Bba203 unit 2 operating system concepts
Bba203   unit 2 operating system conceptsBba203   unit 2 operating system concepts
Bba203 unit 2 operating system concepts
 
Cs8493 unit 2
Cs8493 unit 2Cs8493 unit 2
Cs8493 unit 2
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case study
 
Storage management
Storage managementStorage management
Storage management
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Memory management OS
Memory management OSMemory management OS
Memory management OS
 
Operating System a Case Study
Operating System a Case StudyOperating System a Case Study
Operating System a Case Study
 
Lecture 3,4 operating systems
Lecture 3,4   operating systemsLecture 3,4   operating systems
Lecture 3,4 operating systems
 
Operating system-1
Operating system-1Operating system-1
Operating system-1
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
 
Cs8493 unit 5
Cs8493 unit 5Cs8493 unit 5
Cs8493 unit 5
 
Operating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management ConceptsOperating Systems 1 (9/12) - Memory Management Concepts
Operating Systems 1 (9/12) - Memory Management Concepts
 

Similar to OS Memory Management Concepts

Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSKumar Pritam
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management ghayour abbas
 
M20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptxM20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptxHarikishnaKNHk
 
Advanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeAdvanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeLalfakawmaKh
 
memory managment on computer science.ppt
memory managment on computer science.pptmemory managment on computer science.ppt
memory managment on computer science.pptfootydigarse
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxMadhuraK13
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OSC.U
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Managementdonny101
 

Similar to OS Memory Management Concepts (20)

unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
M20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptxM20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptx
 
Memory management
Memory managementMemory management
Memory management
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Advanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeAdvanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and Type
 
memory managment on computer science.ppt
memory managment on computer science.pptmemory managment on computer science.ppt
memory managment on computer science.ppt
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptx
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Operating System-2 by Adi.pdf
Operating System-2 by Adi.pdfOperating System-2 by Adi.pdf
Operating System-2 by Adi.pdf
 
Operating system
Operating systemOperating system
Operating system
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
OS Unit 2.pptx
OS Unit 2.pptxOS Unit 2.pptx
OS Unit 2.pptx
 
Memory comp
Memory compMemory comp
Memory comp
 

More from Prof. Dr. K. Adisesha

Software Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfSoftware Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfSoftware Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfSoftware Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfSoftware Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfSoftware Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfProf. Dr. K. Adisesha
 
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfSoftware Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfProf. Dr. K. Adisesha
 
Computer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaComputer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaProf. Dr. K. Adisesha
 
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaCCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaProf. Dr. K. Adisesha
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaProf. Dr. K. Adisesha
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaProf. Dr. K. Adisesha
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfProf. Dr. K. Adisesha
 

More from Prof. Dr. K. Adisesha (20)

Software Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfSoftware Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdf
 
Software Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfSoftware Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdf
 
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfSoftware Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
 
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfSoftware Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
 
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfSoftware Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
 
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfSoftware Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
 
Computer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaComputer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. Adisesha
 
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaCCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. Adisesha
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdf
 
Introduction to Computers.pdf
Introduction to Computers.pdfIntroduction to Computers.pdf
Introduction to Computers.pdf
 
R_Programming.pdf
R_Programming.pdfR_Programming.pdf
R_Programming.pdf
 
Scholarship.pdf
Scholarship.pdfScholarship.pdf
Scholarship.pdf
 
Operating System-1 by Adi.pdf
Operating System-1 by Adi.pdfOperating System-1 by Adi.pdf
Operating System-1 by Adi.pdf
 
Operating System-adi.pdf
Operating System-adi.pdfOperating System-adi.pdf
Operating System-adi.pdf
 
Data_structure using C-Adi.pdf
Data_structure using C-Adi.pdfData_structure using C-Adi.pdf
Data_structure using C-Adi.pdf
 
JAVA PPT -2 BY ADI.pdf
JAVA PPT -2 BY ADI.pdfJAVA PPT -2 BY ADI.pdf
JAVA PPT -2 BY ADI.pdf
 
JAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdfJAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdf
 
JAVA PPT -3 BY ADI.pdf
JAVA PPT -3 BY ADI.pdfJAVA PPT -3 BY ADI.pdf
JAVA PPT -3 BY ADI.pdf
 

Recently uploaded

KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

OS Memory Management Concepts

  • 1. Introduction to Operating Systems – 3 Memory Management PROF. K. ADISESHA
  • 2. Introduction to Operating System Memory Concepts Memory Allocation Memory Partitions Paging Virtual Memory 2 Memory Management
  • 3. Introduction Prof. K. Adisesha (Ph. D) 3 Memory Hierarchy Design: In the Computer System Design, Memory Hierarchy is an enhancement to organize the memory such that it can minimize the access time. ➢The Memory Hierarchy was developed based on a program behavior known as locality of references. ➢This Memory Hierarchy Design is divided into 2 main types: ❖External Memory or Secondary Memory: Comprising of Magnetic Disk, Optical Disk, Magnetic Tape i.e. peripheral storage devices which are accessible by the processor via I/O Module. ❖Internal Memory or Primary Memory: Comprising of Main Memory, Cache Memory & CPU registers. This is directly accessible by the processor. ➢,
  • 4. Introduction Prof. K. Adisesha (Ph. D) 4 Memory Management: Memory management is the functionality of an operating system which handles or manages primary memory and moves processes back and forth between main memory and disk during execution. ➢Main Memory refers to a physical memory that is the internal memory to the computer. ➢Memory management keeps track of each and every memory location, regardless of either it is allocated to some process or it is free. ➢It checks how much memory is to be allocated to processes. ➢It decides which process will get memory at what time. ➢It tracks whenever some memory gets freed or unallocated and correspondingly it updates the status.
  • 5. Introduction Prof. K. Adisesha (Ph. D) 5 Process Address Space: The process address space is the set of logical addresses that a process references in its code. ➢ The operating system takes care of mapping the logical addresses to physical addresses at the time of memory allocation to the program. ➢ There are three types of addresses used in a program before and after memory is allocated . ❖Symbolic addresses: The addresses used in a source code. The variable names, constants, and instruction labels are the basic elements of the symbolic address space. ❖Relative addresses: At the time of compilation, a compiler converts symbolic addresses into relative addresses. ❖Physical addresses: The loader generates these addresses at the time when a program is loaded into main memory.
  • 6. Memory Loading Prof. K. Adisesha (Ph. D) 6 Memory Loading: All the programs are loaded in the main memory for execution. Sometimes complete program is loaded into the memory, but some times a certain part or routine of the program is loaded into the main memory only when it is called by the program. ➢ There are two types of Loading techniques: ❖ Static Loading: The absolute program (and data) is loaded into memory in order for execution to start. ❖ Dynamic Loading: dynamic routines of the library are stored on a disk in relocatable form and are loaded into memory only when they are needed by the program.
  • 7. Memory Loading Prof. K. Adisesha (Ph. D) 7 Swapping: Swapping is the process of bringing in each process in main memory, running it for a while and then putting it back to the disk. ➢ Swapping is also known as a technique for memory compaction. ➢ sometimes there is not enough main memory to hold all the currently active processes in a timesharing system. ➢ The total time taken by swapping process includes the time it takes to move the entire process to a secondary disk and then to copy the process back to memory, as well as the time the process takes to regain main memory.
  • 8. Memory Allocation Prof. K. Adisesha (Ph. D) 8 Memory Allocation: 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 requirement. ➢ Paged memory management: Memory is divided into fixed-sized units called page frames, used in a virtual memory environment. ➢ Segmented memory management: Memory is divided into different segments. In this management, allocated memory doesn’t have to be contiguous.
  • 9. Memory Allocation Prof. K. Adisesha (Ph. D) 9 Partition Allocation : In Partition Allocation, when there is more than one partition freely available to accommodate a process’s request, a partition must be selected. ➢To choose a particular partition, a partition allocation method is needed. ➢When it is time to load a process into the main memory and if there is more than one free block of memory of sufficient size then the OS decides which free block to allocate. ➢There are different Placement Algorithm: ❖First Fit: The first hole that is big enough is allocated to program. ❖Best Fit: The smallest hole that is big enough is allocated to program. ❖Worst Fit: The largest hole that is big enough is allocated to program.
  • 10. Memory Allocation Prof. K. Adisesha (Ph. D) 10 Memory Partitions : Memory allocation is a process by which computer programs are assigned memory or space. ➢Main memory usually has two partitions − ❖Low Memory − Operating system resides in this memory. ❖High Memory − User processes are held in high memory. ➢Operating system uses the following memory allocation mechanism. ➢Memory Partitioning types are: ❖Fixed / Static-partition allocation ❖Dynamic/ Multiple-partition allocation
  • 11. Memory Allocation Prof. K. Adisesha (Ph. D) 11 Dynamic Memory Partitioning: In this technique, the partition size is not declared initially. It is declared at the time of process loading ➢ The first partition is reserved for the operating system. ➢ The remaining space is divided into parts. ➢ The size of each partition will be equal to the size of the process. ➢ The partition size varies according to the need of the process so that the internal fragmentation can be avoided
  • 12. Memory Allocation Prof. K. Adisesha (Ph. D) 12 Fixed / Contiguous Memory Partitions : In this type of allocation, main memory is divided into a number of fixed-sized partitions where each partition should contain only one process. ➢ In this technique, the main memory is divided into partitions of equal or different sizes. ➢ The operating system always resides in the first partition while the other partitions can be used to store user processes. ➢ The memory is assigned to the processes in contiguous way. ➢ The partitions cannot overlap. ➢ A process must be contiguously present in a partition for the execution
  • 13. Memory Allocation Prof. K. Adisesha (Ph. D) 13 Fragmentation: Fragmentation is an unwanted problem where the memory blocks cannot be allocated to the processes due to their small size and the blocks remain unused. ➢ The process with the size greater than the size of the largest partition could not be executed due to the lack of sufficient contiguous memory blocks cannot be allocated to new upcoming processes and results in inefficient use of memory. ➢ Basically, there are two types of fragmentation: ❖Internal Fragmentation ❖External Fragmentation
  • 14. Memory Allocation Prof. K. Adisesha (Ph. D) 14 Internal Fragmentation: Memory block assigned to process is bigger. Some portion of memory is left unused, as it cannot be used by another process. ➢ In this fragmentation, the process is allocated a memory block of size more than the size of that process. ➢ Due to this some part of the memory is left unused and this cause internal fragmentation.
  • 15. Memory Allocation Prof. K. Adisesha (Ph. D) 15 External Fragmentation: Total memory space is enough to satisfy a request or to reside a process in it, but it is not contiguous, so it cannot be used. ➢ In this fragmentation, although we have total space available that is needed by a process still we are not able to put that process in the memory because that space is not contiguous. ➢ After some time P1 and P3 got completed and their assigned space is freed, but they cannot be used to load a 2 MB process in the memory since they are not contiguously located
  • 16. Memory Allocation Prof. K. Adisesha (Ph. D) 16 Compaction: Compaction technique can be used to create more free memory out of fragmented memory. ➢External fragmentation can be reduced by compaction or shuffle memory contents to place all free memory together in one large block. To make compaction feasible, relocation should be dynamic. ➢The internal fragmentation can be reduced by effectively assigning the smallest partition but large enough for the process.
  • 17. Memory Allocation Prof. K. Adisesha (Ph. D) 17 Paging: Pages of the process are brought into the main memory only when they are required otherwise they reside in the secondary storage. ➢ Considering the fact that the pages are mapped to the frames in Paging, page size needs to be as same as frame size. ➢ Different operating system defines different frame sizes. ➢ The pages belonging to a certain process are loaded into available. ➢ The sizes of each frame must be equal. ➢ Pages size is power of 2, between 512 bytes and 8192 bytes. ➢ The size of the process is measured in the number of pages..
  • 18. Memory Allocation Prof. K. Adisesha (Ph. D) 18 Paging: Address Translation. ➢ Page address is called logical address and represented by page number and the offset. ❖ Logical Address = Page number + page offset ➢ Frame address is called physical address and represented by a frame number and the offset. ❖ Physical Address = Frame number + page offset ➢ A data structure called page map table is used to keep track of the relation between a page of a process to a frame in physical memory.
  • 19. Memory Allocation Prof. K. Adisesha (Ph. D) 19 Paging Faults: A page fault occurs when a program attempts to access a block of memory that is not stored in the physical memory, or RAM. ➢ The fault notifies the operating system that it must locate the data in virtual memory, then transfer it from the storage device to the system RAM. ➢ Page fault arise the exception, that specifies the O/S, which access the memory slots from virtual memory for running the program in continue nature.
  • 20. Virtual memory Prof. K. Adisesha (Ph. D) 20 Definition: Virtual memory is a feature of an operating system that enables a computer to be able to compensate shortages of physical memory by transferring pages of data from random access memory to disk storage. ➢ Virtual memory is a memory management technique where secondary memory can be used as if it were a part of the main memory ➢ Virtual memory serves two purposes. ❖ It allows us to extend the use of physical memory. ❖ It allows us to have memory protection, because each virtual address is translated to a physical address.
  • 21. Virtual memory Prof. K. Adisesha (Ph. D) 21 Virtual memory: Virtual memory allows a computer to treat secondary memory as though it were the main memory. ➢ Virtual memory uses hardware and software to allow a computer to compensate for physical memory shortages. ➢ Memory manager is in charge of keeping track of the shifts between physical and virtual memory. ➢ Types of virtual memory are: ❖ Demand Paging ❖ Segmentation
  • 22. Virtual memory Prof. K. Adisesha (Ph. D) 22 Demand Paging: A demand paging system is quite similar to a paging system with swapping where processes reside in secondary memory and pages are loaded only on demand, not in advance. ➢ Types of Page Replacement Methods are: ❖ FIFO ❖ Optimal Algorithm ❖ LRU Page Replacement
  • 23. Virtual memory Prof. K. Adisesha (Ph. D) 23 FIFO Page Replacement: FIFO (First-in-first-out) is a simple implementation method, the process selects the page for a replacement that has been in the virtual address of the memory for the longest time. ➢ Features of FIFO Page Replacement Methods are: ❖ Whenever a new page loaded, the page recently comes in the memory is removed. ❖ The oldest page in the main memory is one that should be selected for replacement first
  • 24. Virtual memory Prof. K. Adisesha (Ph. D) 24 Optimal Algorithm: The optimal page replacement method selects that page for a replacement for which the time to the next reference is the longest. ➢ Features of Optimal algorithm are: ❖ Optimal algorithm results in the fewest number of page faults. This algorithm is difficult to implement. ❖ Replace the page which unlike to use for a longer period of time. It only uses the time when a page needs to be used.
  • 25. Virtual memory Prof. K. Adisesha (Ph. D) 25 LRU Page Replacement: Least Recently Used (LRU) page, this method helps OS to find page usage over a short period of time. ➢ This algorithm should be implemented by associating a counter with an even- page. ➢ Features of LRU Page Replacement are: ❖ The LRU replacement method has the highest count. This counter is also called aging registers, which specify their age and how much their associated pages should also be referenced. ❖ The page which hasn't been used for the longest time in the main memory is the one that should be selected for replacement. ❖ It also keeps a list and replaces pages by looking back into time
  • 26. Virtual memory Prof. K. Adisesha (Ph. D) 26 Virtual memory: Virtual memory is important for improving system performance, multitasking, using large programs and flexibility. ➢ Benefits of using virtual memory ❖ Frees applications from managing shared memory and saves users from having to add memory modules when RAM space runs out. ❖ Increased security because of memory isolation. ❖ Multiple larger applications can be run simultaneously. ❖ Doesn't need external fragmentation. ❖ Effective CPU use. ❖ Data can be moved automatically.
  • 27. Operating System - Properties Prof. K. Adisesha (Ph. D) 27 Distributed Environment: A distributed environment refers to multiple independent CPUs or processors in a computer system. ➢ An operating system does the following activities related to distributed environment: ❖ The OS distributes computation logics among several physical processors. ❖ The processors do not share memory or a clock. Instead, each processor has its own local memory. ❖ The OS manages the communications between the processors. ❖ They communicate with each other through various communication lines.
  • 28. Operating System - Properties Prof. K. Adisesha (Ph. D) 28 Spooling: Spooling is an acronym for simultaneous peripheral operations on line. ➢ Spooling refers to putting data of various I/O jobs in a buffer. ➢ This buffer is a special area in memory or hard disk which is accessible to I/O devices. ➢ Advantages ❖ The spooling operation uses a disk as a very large buffer. ❖ Spooling is capable of overlapping I/O operation for one job with processor operations for another job.
  • 29. Operating System - Properties Prof. K. Adisesha (Ph. D) 29 Spooling: Spooling is an acronym for simultaneous peripheral operations on line. ➢ Spooling refers to putting data of various I/O jobs in a buffer. ➢ An operating system does the following activities related to distributed environment . ❖ Handles I/O device data spooling as devices have different data access rates. ❖ Maintains the spooling buffer which provides a waiting station where data can rest while the slower device catches up. ❖ Maintains parallel computation because of spooling process as a computer can perform I/O in parallel fashion. ❖ It becomes possible to have the computer read data from a tape, write data to disk and to write out to a tape printer while it is doing its computing task
  • 30. Discussion Prof. K. Adisesha (Ph. D) 30 Queries ? Prof. K. Adisesha 9449081542