SlideShare a Scribd company logo
1 of 37
UNIT II
 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.
 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.
 Logical Address is generated by CPU while a program is running.
 The logical address is virtual address as it does not exist physically, therefore, it is
also known as Virtual Address.
 This address is used as a reference to access the physical memory location by
CPU.
 The hardware device called Memory-Management Unit is used for mapping
logical address to its corresponding physical address.
 Physical Address identifies a physical location of required data in a memory.
 The user never directly deals with the physical address but can access by its
corresponding logical address.
 The user program generates the logical address and thinks that the program is
running in this logical address but the program needs physical memory for its
execution, therefore, the logical address must be mapped to the physical address
by MMU before they are used.
 The term Physical Address Space is used for all physical addresses corresponding
to the logical addresses in a Logical address space.
PARAMENTER LOGICAL ADDRESS PHYSICAL ADDRESS
Basic generated by CPU location in a memory unit
Address Space
Logical Address Space is
set of all logical addresses
generated by CPU in
reference to a program.
Physical Address is set of
all physical addresses
mapped to the
corresponding logical
addresses.
Visibility
User can view the logical
address of a program.
User can never view
physical address of
program.
Generation generated by the CPU Computed by MMU
Access
The user can use the
logical address to access
the physical address.
The user can indirectly
access physical address
but not directly.
 Swapping is a mechanism in which a process can be swapped temporarily out of
main memory (or move) to secondary storage (disk) and make that memory
available to other processes. At some later time, the system swaps back the
process from the secondary storage to main memory.
 Though performance is usually affected by swapping process but it helps in
running multiple and big processes in parallel and that's the reason Swapping is
also known as a technique for memory compaction.
 As processes are loaded and removed from memory, the free memory space is
broken into little pieces. It happens after sometimes that processes cannot be
allocated to memory blocks considering their small size and memory blocks
remains unused. This problem is known as Fragmentation.
S.N. Fragmentation & Description
1 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.
2 Internal fragmentation
Memory block assigned to process is bigger. Some portion of memory is left unused, as
it cannot be used by another process.
Fragmentation is of two types −
In Operating Systems, Paging is a storage mechanism used to retrieve processes from
the secondary storage into the main memory in the form of pages.
 The main idea behind the paging is to divide each process in the form of pages. The
main memory will also be divided in the form of frames.
 One page of the process is to be stored in one of the frames of the memory. The pages
can be stored at the different locations of the memory but the priority is always to find
the contiguous frames or holes.
 Pages of the process are brought into the main memory only when they are required
otherwise they reside in the secondary storage.
 Different operating system defines different frame sizes. The sizes of each frame must
be equal. Considering the fact that the pages are mapped to the frames in Paging,
page size needs to be as same as frame size.
 Let us consider the main memory size 16 Kb and Frame size is 1 KB therefore the
main memory will be divided into the collection of 16 frames of 1 KB each.
 There are 4 processes in the system that is P1, P2, P3 and P4 of 4 KB each. Each
process is divided into pages of 1 KB each so that one page can be stored in one
frame.
 Initially, all the frames are empty therefore pages of the processes will get stored
in the contiguous way.
 Page address is called logical address and represented by page number and
the offset.
 Frame address is called physical address and represented by a frame number and
the offset.
Logical Address = Page number + page offset
Physical Address = Frame number + page offset
Here is a list of advantages and disadvantages of paging −
 Paging reduces external fragmentation, but still suffer from internal
fragmentation.
 Paging is simple to implement and assumed as an efficient memory management
technique.
 Due to equal size of the pages and frames, swapping becomes very easy.
 Page table requires extra memory space, so may not be good for a system having
small RAM.
 Segmentation is a memory management technique in which each job is divided into
several segments of different sizes, one for each module that contains pieces that
perform related functions. Each segment is actually a different logical address space of
the program.
 When a process is to be executed, its corresponding segmentation are loaded into non-
contiguous memory though every segment is loaded into a contiguous block of
available memory.
 Segmentation memory management works very similar to paging but here segments
are of variable-length where as in paging pages are of fixed size.
 A program segment contains the program's main function, utility functions, data
structures, and so on. The operating system maintains a segment map table for every
process and a list of free memory blocks along with segment numbers, their size and
corresponding memory locations in main memory. For each segment, the table stores
the starting address of the segment and the length of the segment. A reference to a
memory location includes a value that identifies a segment and an offset.
 A computer can address more memory than the amount physically installed on the
system. This extra memory is actually called virtual memory and it is a section of a
hard disk that's set up to emulate the computer's RAM.
Following are the situations, when entire program is not required to be loaded fully in
main memory.
 User written error handling routines are used only when an error occurred in the data
or computation.
 Certain options and features of a program may be used rarely.
 Many tables are assigned a fixed amount of address space even though only a small
amount of the table is actually used.
 The ability to execute a program that is only partially in memory would counter many
benefits.
 Less number of I/O would be needed to load or swap each user program into memory.
 A program would no longer be constrained by the amount of physical memory that is
available.
 Each user program could take less physical memory, more programs could be run the
same time, with a corresponding increase in CPU utilization and throughput.
 Modern microprocessors
intended for general-
purpose use, a memory
management unit, or
MMU, is built into the
hardware. The MMU's job
is to translate virtual
addresses into physical
addresses. A basic example
is given below −
 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.
Advantages
 Large virtual memory.
 More efficient use of memory.
 There is no limit on degree of multiprogramming.
Disadvantages
 Number of tables and the amount of processor overhead for handling page
interrupts are greater than in the case of the simple paged management
techniques.
 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, such as an HDD or SSD, to the system RAM.
First In First Out (FIFO) algorithm
 Oldest page in main memory is
the one which will be selected for
replacement.
 Easy to implement, keep a list,
replace pages from the tail and
add new pages at the head.
 An optimal page-replacement
algorithm has the lowest page-fault
rate of all algorithms. An optimal
page-replacement algorithm exists,
and has been called OPT or MIN.
 Replace the page that will not be used
for the longest period of time. Use the
time when a page is to be used.
 Page which has not been used for the
longest time in main memory is the
one which will be selected for
replacement.
 Easy to implement, keep a list, replace
pages by looking back into time.
 The page with the smallest count is the one which will be selected for
replacement.
 This algorithm suffers from the situation in which a page is used heavily during
the initial phase of a process, but then is never used again.
 This algorithm is based on the argument that the page with the smallest count
was probably just brought in and has yet to be used.
Performance of Demand Paging
 The performance of demand paging is often measured in terms of the effective access
time.
 Effective access time is the amount of time it takes to access memory, if the cost of page
faults are amortized over all memory accesses.
 In some sense it is an average or expected access time.
ea = (1 - p) * ma + p*pft
ea = effective access time
ma = physical memory (core) access time
pft = page fault time
p = probability of a page fault occuring
(1-p) = the probability of accessing memory in an available frame
The page fault time is the sum of the additional overhead associated with accessing a
page in the backing store.
This includes additional context switches, disk latency and transfer time associated with
page-in and page-out operations,
the overhead of executing an operating system trap,.
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.
 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.
 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.
 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.
 Advantage: All the processes share the available frames according to their needs,
rather than equally.
 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.
 Advantage: The pages in memory for a particular process and the page fault ratio is
affected by the paging behavior of only that process.
 Disadvantage: A low priority process may hinder a high priority process by not making
its frames available to the high priority process.
 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.
Advantage: Does not hinder the performance of processes and hence results in greater
system throughput.
 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.
 If the page fault and then swapping happening very frequently at higher rate,
then operating system has to spend more time to swap these pages. This state is
called thrashing. Because of this, CPU utilization is going to be reduced.
 Working Set Model
 This model is based on locality. What locality is saying, the page used recently can
be used again and also the pages which are nearby this page will also be used.
Working set means set of pages in the most recent D time. The page which
completed its D amount of time in working set automatically dropped from it. So
accuracy of working set depends on D we have chosen. This working set model
avoid thrashing while keeping the degree of multiprogramming as high as
possible.
 Page Fault Frequency
 It is some direct approach than working set model. When thrashing occurring we
know that it has few number of frames. And if it is not thrashing that means it
has too many frames. Based on this property we assign an upper and lower bound
for the desired page fault rate. According to page fault rate we allocate or remove
pages. If the page fault rate become less than the lower limit, frames can be
removed from the process. Similarly, if the page fault rate become more than the
upper limit, more number of frames can be allocated to the process. And if no
frames available due to high page fault rate, we will just suspend the processes
and will restart them again when frames available.
 END OF UNIT II

More Related Content

What's hot

Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43myrajendra
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory managementMukesh Chinta
 
Operating System Operations ppt.pptx
Operating System Operations ppt.pptxOperating System Operations ppt.pptx
Operating System Operations ppt.pptxMSivani
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmssangrampatil81
 
Multi Processors And Multi Computers
 Multi Processors And Multi Computers Multi Processors And Multi Computers
Multi Processors And Multi ComputersNemwos
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating SystemSoumit Ghosh
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementAjit Nayak
 
Amoeba distributed operating System
Amoeba distributed operating SystemAmoeba distributed operating System
Amoeba distributed operating SystemSaurabh Gupta
 
OS Memory Management
OS Memory ManagementOS Memory Management
OS Memory Managementanand hd
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentationRanjeet Kumar
 

What's hot (20)

Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Cache memory
Cache memoryCache memory
Cache memory
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Memory management
Memory managementMemory management
Memory management
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Memory management
Memory managementMemory management
Memory management
 
Operating System Operations ppt.pptx
Operating System Operations ppt.pptxOperating System Operations ppt.pptx
Operating System Operations ppt.pptx
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Multi Processors And Multi Computers
 Multi Processors And Multi Computers Multi Processors And Multi Computers
Multi Processors And Multi Computers
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
 
Amoeba distributed operating System
Amoeba distributed operating SystemAmoeba distributed operating System
Amoeba distributed operating System
 
OS Memory Management
OS Memory ManagementOS Memory Management
OS Memory Management
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentation
 

Similar to Os unit 2

Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementkazim Hussain
 
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptxSTORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptxDivyaKS18
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual MemoryArchith777
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment HelpJosephErin
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggBHUPESHRAHANGDALE200
 
Memory management ppt coa
Memory management ppt coaMemory management ppt coa
Memory management ppt coaBharti Khemani
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memoryghayour abbas
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.pptPratikBose10
 

Similar to Os unit 2 (20)

Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptxSTORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
STORAGE MANAGEMENT AND PAGING ALGORITHMS.pptx
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment Help
 
Memory management
Memory managementMemory management
Memory management
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory Managementgggffffffffffgggggggggg
 
Memory management ppt coa
Memory management ppt coaMemory management ppt coa
Memory management ppt coa
 
Operating system
Operating systemOperating system
Operating system
 
CSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual MemoryCSI-503 - 9. Virtual Memory
CSI-503 - 9. Virtual Memory
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
 
Module 4 memory management
Module 4 memory managementModule 4 memory management
Module 4 memory management
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
Os
OsOs
Os
 

More from Arnav Chowdhury

Startup Funding and Strategies for Future
Startup Funding and Strategies for FutureStartup Funding and Strategies for Future
Startup Funding and Strategies for FutureArnav Chowdhury
 
Marketing Management Introduction.pptx
Marketing Management Introduction.pptxMarketing Management Introduction.pptx
Marketing Management Introduction.pptxArnav Chowdhury
 
Marketing Management Product.pptx
Marketing Management Product.pptxMarketing Management Product.pptx
Marketing Management Product.pptxArnav Chowdhury
 
Institutional Support to Entrepreneurship
Institutional Support to EntrepreneurshipInstitutional Support to Entrepreneurship
Institutional Support to EntrepreneurshipArnav Chowdhury
 
New Venture Expansion and Exit Strategies
New Venture Expansion and Exit StrategiesNew Venture Expansion and Exit Strategies
New Venture Expansion and Exit StrategiesArnav Chowdhury
 
Creating a Business Plan
Creating a Business PlanCreating a Business Plan
Creating a Business PlanArnav Chowdhury
 
Business Research Methodology ( Data Collection)
Business Research Methodology ( Data Collection)Business Research Methodology ( Data Collection)
Business Research Methodology ( Data Collection)Arnav Chowdhury
 
Business Research Methods (Introduction)
Business Research Methods (Introduction)Business Research Methods (Introduction)
Business Research Methods (Introduction)Arnav Chowdhury
 
Planning and organizing Entrepreneurial Venture
Planning and organizing Entrepreneurial VenturePlanning and organizing Entrepreneurial Venture
Planning and organizing Entrepreneurial VentureArnav Chowdhury
 
Fundamentals of Entrepreneurship
Fundamentals of EntrepreneurshipFundamentals of Entrepreneurship
Fundamentals of EntrepreneurshipArnav Chowdhury
 
Unit v: Cyber Safety Mechanism
Unit v: Cyber Safety MechanismUnit v: Cyber Safety Mechanism
Unit v: Cyber Safety MechanismArnav Chowdhury
 
UNIT IV:Security Measurement Strategies
UNIT IV:Security Measurement StrategiesUNIT IV:Security Measurement Strategies
UNIT IV:Security Measurement StrategiesArnav Chowdhury
 
Unit iii: Common Hacking Techniques
Unit iii: Common Hacking TechniquesUnit iii: Common Hacking Techniques
Unit iii: Common Hacking TechniquesArnav Chowdhury
 
Information Technology and Modern Gadgets
Information Technology and Modern GadgetsInformation Technology and Modern Gadgets
Information Technology and Modern GadgetsArnav Chowdhury
 

More from Arnav Chowdhury (20)

Startup Funding and Strategies for Future
Startup Funding and Strategies for FutureStartup Funding and Strategies for Future
Startup Funding and Strategies for Future
 
Marketing Management Introduction.pptx
Marketing Management Introduction.pptxMarketing Management Introduction.pptx
Marketing Management Introduction.pptx
 
Marketing Management Product.pptx
Marketing Management Product.pptxMarketing Management Product.pptx
Marketing Management Product.pptx
 
Institutional Support to Entrepreneurship
Institutional Support to EntrepreneurshipInstitutional Support to Entrepreneurship
Institutional Support to Entrepreneurship
 
New Venture Expansion and Exit Strategies
New Venture Expansion and Exit StrategiesNew Venture Expansion and Exit Strategies
New Venture Expansion and Exit Strategies
 
Creating a Business Plan
Creating a Business PlanCreating a Business Plan
Creating a Business Plan
 
Business Research Methodology ( Data Collection)
Business Research Methodology ( Data Collection)Business Research Methodology ( Data Collection)
Business Research Methodology ( Data Collection)
 
Business Research Methods (Introduction)
Business Research Methods (Introduction)Business Research Methods (Introduction)
Business Research Methods (Introduction)
 
Planning and organizing Entrepreneurial Venture
Planning and organizing Entrepreneurial VenturePlanning and organizing Entrepreneurial Venture
Planning and organizing Entrepreneurial Venture
 
Fundamentals of Entrepreneurship
Fundamentals of EntrepreneurshipFundamentals of Entrepreneurship
Fundamentals of Entrepreneurship
 
ICT tools in Education
ICT tools in EducationICT tools in Education
ICT tools in Education
 
Unit v: Cyber Safety Mechanism
Unit v: Cyber Safety MechanismUnit v: Cyber Safety Mechanism
Unit v: Cyber Safety Mechanism
 
UNIT IV:Security Measurement Strategies
UNIT IV:Security Measurement StrategiesUNIT IV:Security Measurement Strategies
UNIT IV:Security Measurement Strategies
 
Unit iii: Common Hacking Techniques
Unit iii: Common Hacking TechniquesUnit iii: Common Hacking Techniques
Unit iii: Common Hacking Techniques
 
Cyber Crime
Cyber CrimeCyber Crime
Cyber Crime
 
Information Technology and Modern Gadgets
Information Technology and Modern GadgetsInformation Technology and Modern Gadgets
Information Technology and Modern Gadgets
 
Unit iv FMIS
Unit iv FMISUnit iv FMIS
Unit iv FMIS
 
Unit iii FMIS
Unit iii FMISUnit iii FMIS
Unit iii FMIS
 
Unit ii FMIS
Unit ii FMISUnit ii FMIS
Unit ii FMIS
 
Unit iv graphics
Unit iv  graphicsUnit iv  graphics
Unit iv graphics
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

Os unit 2

  • 2.  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.  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.
  • 3.  Logical Address is generated by CPU while a program is running.  The logical address is virtual address as it does not exist physically, therefore, it is also known as Virtual Address.  This address is used as a reference to access the physical memory location by CPU.  The hardware device called Memory-Management Unit is used for mapping logical address to its corresponding physical address.
  • 4.  Physical Address identifies a physical location of required data in a memory.  The user never directly deals with the physical address but can access by its corresponding logical address.  The user program generates the logical address and thinks that the program is running in this logical address but the program needs physical memory for its execution, therefore, the logical address must be mapped to the physical address by MMU before they are used.  The term Physical Address Space is used for all physical addresses corresponding to the logical addresses in a Logical address space.
  • 5.
  • 6. PARAMENTER LOGICAL ADDRESS PHYSICAL ADDRESS Basic generated by CPU location in a memory unit Address Space Logical Address Space is set of all logical addresses generated by CPU in reference to a program. Physical Address is set of all physical addresses mapped to the corresponding logical addresses. Visibility User can view the logical address of a program. User can never view physical address of program. Generation generated by the CPU Computed by MMU Access The user can use the logical address to access the physical address. The user can indirectly access physical address but not directly.
  • 7.  Swapping is a mechanism in which a process can be swapped temporarily out of main memory (or move) to secondary storage (disk) and make that memory available to other processes. At some later time, the system swaps back the process from the secondary storage to main memory.  Though performance is usually affected by swapping process but it helps in running multiple and big processes in parallel and that's the reason Swapping is also known as a technique for memory compaction.
  • 8.
  • 9.  As processes are loaded and removed from memory, the free memory space is broken into little pieces. It happens after sometimes that processes cannot be allocated to memory blocks considering their small size and memory blocks remains unused. This problem is known as Fragmentation. S.N. Fragmentation & Description 1 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. 2 Internal fragmentation Memory block assigned to process is bigger. Some portion of memory is left unused, as it cannot be used by another process. Fragmentation is of two types −
  • 10. In Operating Systems, Paging is a storage mechanism used to retrieve processes from the secondary storage into the main memory in the form of pages.  The main idea behind the paging is to divide each process in the form of pages. The main memory will also be divided in the form of frames.  One page of the process is to be stored in one of the frames of the memory. The pages can be stored at the different locations of the memory but the priority is always to find the contiguous frames or holes.  Pages of the process are brought into the main memory only when they are required otherwise they reside in the secondary storage.  Different operating system defines different frame sizes. The sizes of each frame must be equal. Considering the fact that the pages are mapped to the frames in Paging, page size needs to be as same as frame size.
  • 11.
  • 12.  Let us consider the main memory size 16 Kb and Frame size is 1 KB therefore the main memory will be divided into the collection of 16 frames of 1 KB each.  There are 4 processes in the system that is P1, P2, P3 and P4 of 4 KB each. Each process is divided into pages of 1 KB each so that one page can be stored in one frame.  Initially, all the frames are empty therefore pages of the processes will get stored in the contiguous way.
  • 13.
  • 14.
  • 15.  Page address is called logical address and represented by page number and the offset.  Frame address is called physical address and represented by a frame number and the offset. Logical Address = Page number + page offset Physical Address = Frame number + page offset
  • 16. Here is a list of advantages and disadvantages of paging −  Paging reduces external fragmentation, but still suffer from internal fragmentation.  Paging is simple to implement and assumed as an efficient memory management technique.  Due to equal size of the pages and frames, swapping becomes very easy.  Page table requires extra memory space, so may not be good for a system having small RAM.
  • 17.  Segmentation is a memory management technique in which each job is divided into several segments of different sizes, one for each module that contains pieces that perform related functions. Each segment is actually a different logical address space of the program.  When a process is to be executed, its corresponding segmentation are loaded into non- contiguous memory though every segment is loaded into a contiguous block of available memory.  Segmentation memory management works very similar to paging but here segments are of variable-length where as in paging pages are of fixed size.  A program segment contains the program's main function, utility functions, data structures, and so on. The operating system maintains a segment map table for every process and a list of free memory blocks along with segment numbers, their size and corresponding memory locations in main memory. For each segment, the table stores the starting address of the segment and the length of the segment. A reference to a memory location includes a value that identifies a segment and an offset.
  • 18.
  • 19.  A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and it is a section of a hard disk that's set up to emulate the computer's RAM. Following are the situations, when entire program is not required to be loaded fully in main memory.  User written error handling routines are used only when an error occurred in the data or computation.  Certain options and features of a program may be used rarely.  Many tables are assigned a fixed amount of address space even though only a small amount of the table is actually used.  The ability to execute a program that is only partially in memory would counter many benefits.  Less number of I/O would be needed to load or swap each user program into memory.  A program would no longer be constrained by the amount of physical memory that is available.  Each user program could take less physical memory, more programs could be run the same time, with a corresponding increase in CPU utilization and throughput.
  • 20.  Modern microprocessors intended for general- purpose use, a memory management unit, or MMU, is built into the hardware. The MMU's job is to translate virtual addresses into physical addresses. A basic example is given below −
  • 21.  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.
  • 22. Advantages  Large virtual memory.  More efficient use of memory.  There is no limit on degree of multiprogramming. Disadvantages  Number of tables and the amount of processor overhead for handling page interrupts are greater than in the case of the simple paged management techniques.
  • 23.  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, such as an HDD or SSD, to the system RAM.
  • 24. First In First Out (FIFO) algorithm  Oldest page in main memory is the one which will be selected for replacement.  Easy to implement, keep a list, replace pages from the tail and add new pages at the head.
  • 25.  An optimal page-replacement algorithm has the lowest page-fault rate of all algorithms. An optimal page-replacement algorithm exists, and has been called OPT or MIN.  Replace the page that will not be used for the longest period of time. Use the time when a page is to be used.
  • 26.  Page which has not been used for the longest time in main memory is the one which will be selected for replacement.  Easy to implement, keep a list, replace pages by looking back into time.
  • 27.  The page with the smallest count is the one which will be selected for replacement.  This algorithm suffers from the situation in which a page is used heavily during the initial phase of a process, but then is never used again.
  • 28.  This algorithm is based on the argument that the page with the smallest count was probably just brought in and has yet to be used.
  • 29. Performance of Demand Paging  The performance of demand paging is often measured in terms of the effective access time.  Effective access time is the amount of time it takes to access memory, if the cost of page faults are amortized over all memory accesses.  In some sense it is an average or expected access time. ea = (1 - p) * ma + p*pft ea = effective access time ma = physical memory (core) access time pft = page fault time p = probability of a page fault occuring (1-p) = the probability of accessing memory in an available frame The page fault time is the sum of the additional overhead associated with accessing a page in the backing store. This includes additional context switches, disk latency and transfer time associated with page-in and page-out operations, the overhead of executing an operating system trap,.
  • 30. 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.
  • 31.  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.  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.
  • 32.  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.  Advantage: All the processes share the available frames according to their needs, rather than equally.
  • 33.  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.  Advantage: The pages in memory for a particular process and the page fault ratio is affected by the paging behavior of only that process.  Disadvantage: A low priority process may hinder a high priority process by not making its frames available to the high priority process.  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. Advantage: Does not hinder the performance of processes and hence results in greater system throughput.  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.
  • 34.  If the page fault and then swapping happening very frequently at higher rate, then operating system has to spend more time to swap these pages. This state is called thrashing. Because of this, CPU utilization is going to be reduced.
  • 35.  Working Set Model  This model is based on locality. What locality is saying, the page used recently can be used again and also the pages which are nearby this page will also be used. Working set means set of pages in the most recent D time. The page which completed its D amount of time in working set automatically dropped from it. So accuracy of working set depends on D we have chosen. This working set model avoid thrashing while keeping the degree of multiprogramming as high as possible.
  • 36.  Page Fault Frequency  It is some direct approach than working set model. When thrashing occurring we know that it has few number of frames. And if it is not thrashing that means it has too many frames. Based on this property we assign an upper and lower bound for the desired page fault rate. According to page fault rate we allocate or remove pages. If the page fault rate become less than the lower limit, frames can be removed from the process. Similarly, if the page fault rate become more than the upper limit, more number of frames can be allocated to the process. And if no frames available due to high page fault rate, we will just suspend the processes and will restart them again when frames available.
  • 37.  END OF UNIT II