SlideShare a Scribd company logo
Operating Systems-
Memory management
PREPARED BY,
V.SANTHI
ASSISTANT PROFESSOR,
DEPARTMENT OF BCA,
BON SECOURS COLLEGE FOR WOMEN,
THANJAVUR.
Memory management : Early systems
Memory Allocation schemes:
Single user configurations
Fixed Partitions
Dynamic Partitions
Relocatable Dynamic Partitions
• Main memory –temporary memory(RAM)
• Secondary memory –Permanent memory(ROM)
• Single user contiguous scheme:
• Single Contiguous Memory Allocation is a simple
memory allocation scheme,
• Requires no special hardware features. Entire available memory
is allocated to a single job.
• In this scheme of allocation, the main memory is divided into 2
contiguous regions.
• One portion is permanently allocated to the operating system. All the remaining
memory is available for a single job, which has to be processed. The Job actually
uses some part of the allocated memory.
• Two h/w items need:
• 1.Register to store address
• 2. Accumulator keep track of the size ,the Program being read into memory
• It doesn’t support multiprogramming or N/W, handle one job at a time.
• All the computer's memory, usually with, the exception of a small portion
reserved for the operating system.
• Early years computer were physically large & low memory capacity.
• If the program doesn’t fit ,either the main memory must be increased or
program must be modified.
• Advantage:
• 1. Simple Allocation
• 2. Entire scheme requires less memory
• 3. Easy to implement & use.
• Disadvantage:
• 1. Memory & CPU not fully Utilized
• 2. User program is being limited.
• It allow multiprogramming within main memory-one partition for each job.
• Each Memory partition was designed when the system power on, and to be
reconfigured when the system shut down(Restart).
• Protect job’s memory space
• Once Partition assigned to a job , no other job will assign to that partition.
• Fixed partition allocation ,protection was mandatory for each partitions.
• Joint responsibility OS –H/W.
Fixed / Static Partitions:
• Its better than single contiguous allocation,
because it allow several program into
main memory at the same time.
• Internal fragmentation-drawback
• 100k
• J1= 75k
• 25k
• J2=25k
• 50k
• J3=45k
• 25k
• J4=23k
OS
DYNAMIC PARTITION:
• Partitions(MM) are created dynamically.
• Dynamic partition utilizes the memory when the 1st job load , jobs are not
in same size.
• It fit into the available space based on priority. (First come – First served
bases.).
• Memory creates fragment of free memory b/w blocks called external
fragmentation.
100k
150k
200k
OS
Best fit vs First fit:
• Best fit:
• The best fit deals with allocating the smallest free partition which meets
the requirement of the requesting process. This algorithm first searches the
entire list of free partitions and considers the smallest hole that is adequate.
It then tries to find a hole which is close to actual process size needed.
• J1-135k 100k - waiting job
• j2-75k 150k =15free
• j3-165k 200k =35 free
• Disadvantage: upcoming job must be wait till memory to be arrange
75k
165k
75k
135k
First fit
• In the first fit approach is to allocate the first free partition or hole large
enough which can accommodate the process. It finishes after finding
the first suitable free partition.
• 100k - waiting job
• 150k =100free
• 200k =150 free
J1-
10k
J2-
50k
J3-
50k
J4-
50k
Deallocation:100k free50k called de-allocation
• Deallocation of memory by the Operating System (OS) is a way to free the
Random Access Memory (RAM) of finished processes. New processes
are allocated again. This is how the OS works
with allocation and deallocation.
• In fixed partition- when job is completed memory manager resets the
memory block free –to store another job.
• 1.when the block to be de-allocated is adjacent(3-free-busy-free) to another
free block.
• 2.when the block to be de-allocated is b/w two free block.
• 3.when the block to be de-allocated is isolated from other free block.
J1-
50k
J1-50k
50k
Null entry:
• the status is changed from “a null entry to free” – indicate that a
new block of memory is available.
• When the null entry found, the beginning memory location of the
terminating job is entered in the beginning address column,(1000)
• the job size is entered under the memory block size column.
Relocatable dynamic partitions:
• In relocatable dynamic partition, memory manager in operating system
relocates the program, that is all empty blocks are gathered to form one
single block of large memory enough to accommodate some or all of the
jobs waiting in the queue.
• Compaction(defragmentation & garbage collection)- combining all the
empty memory spaces together.
Compaction
• it’s not a easy task, every program memory must be reallocated, so they are
contiguous, - every address, every reference to an address within the each
program must be adjusted to new location in memory.- OS must be
differentiate ADDRESS & DATA VALUE.
• All numbers are stored in memory as binary values.
• Assembly language instruction to ADD integer 1 to I,
• Instruction like ADDI A ,1 ex: (A+1)
Flag:
• A flag is a value that acts as a signal for a function or process. The value of
the flag is used to determine the next step of a program.
• Flags are often binary flags, which contain a Boolean value (true or false).
However, not all flags are binary, meaning they can store a range of values.
After relocation & compaction – free list & busy list updated
Show block of free memory show the new location of the job
under the process
Register: used to relocate the memory
1.Bound Register- store highest/lowest memory location
2.Relocation Register-value must be added to each address
referenced in program(correct memory address)
It has 3 approach in relocating memory:
• One is ->100k -75% used
• Balance 25% memory wasted
• Second is: compact memory only- constant checking of entry queue
• Make jobs were waiting.
• 3rd one:
• Prescribed amount of time elapsed, if chosen time is too small , system will
spend more time on compaction on processing.
PAGED MEMORY ALLOCATION:
• Before job loaded into memory divided into some parts called page-in memory location its called page frames.
• Paged memory allocation – based on dividing each incoming job into pages of equal size- some OS page size is equal size of
memory Block size.
• Page can be stored in any available page frame in main memory
• Operating systems, paging is a memory management scheme -a computer stores and retrieves data from secondary storage for
use in main memory. In this scheme, the operating system retrieves data from secondary storage in same-size blocks called
pages.
• Advantage : storing program is Non-contiguous in Main memory- so its more efficiently use any page of any job
• Before executing a program, memory manager prepares it by:
1) Determining the number of pages in the program
2) Locating enough empty “page frames” in main memory
3) Loading all of the program’s page into them(MM).
• 1st page contains first instruction.
• Last page contains last instruction
• job1 divided into 4 pages: page 0,page 1, page 2, page 3,
• Total job size: 350bytes,
• page 0 - 100
• page 1 - 100
• page 2 - 100
• page 3 – 50 (few job size perfectly fill with page size)so internal
fragmentation occurs.
• Next job must be wait till job1 ends.
• If job is Larger than 1100 bytes it never fit to memory.
• It is Non-Contiguous storage.

More Related Content

What's hot

Demand paging
Demand pagingDemand paging
Demand paging
Trinity Dwarka
 
Memory management
Memory managementMemory management
Memory management
Rajni Sirohi
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
Akmal Cikmat
 
Memory management
Memory managementMemory management
Memory management
Mohammad Sadiq
 
Demand paging
Demand pagingDemand paging
Demand paging
SwaroopSorte
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
aaina_katyal
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
Mazin Alwaaly
 
9 virtual memory management
9 virtual memory management9 virtual memory management
9 virtual memory management
Dr. Loganathan R
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
Shashank Asthana
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
hamza haseeb
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
sanjana mun
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
Arpita Naik
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
Muhammad Farooq
 
Ch02 early system memory management
Ch02 early system  memory managementCh02 early system  memory management
Ch02 early system memory management
Jacob Cadeliña
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
infomerlin
 
Ch4 memory management
Ch4 memory managementCh4 memory management
Ch4 memory management
Bullz Musetsho
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Boot process
Boot processBoot process
Boot process
Salman Memon
 
Overview of physical storage media
Overview of physical storage mediaOverview of physical storage media
Overview of physical storage media
Srinath Sri
 

What's hot (20)

Demand paging
Demand pagingDemand paging
Demand paging
 
Memory management
Memory managementMemory management
Memory management
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
9 virtual memory management
9 virtual memory management9 virtual memory management
9 virtual memory management
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Ch02 early system memory management
Ch02 early system  memory managementCh02 early system  memory management
Ch02 early system memory management
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
 
Ch4 memory management
Ch4 memory managementCh4 memory management
Ch4 memory management
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Boot process
Boot processBoot process
Boot process
 
Overview of physical storage media
Overview of physical storage mediaOverview of physical storage media
Overview of physical storage media
 

Similar to Memory Management

Memory Management
Memory ManagementMemory Management
Memory Management
jayalakshmi268
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
ssusera387fd1
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
rprajat007
 
Storage management
Storage managementStorage management
Storage management
Atul Sharma
 
M20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptxM20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptx
HarikishnaKNHk
 
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
LeahRachael
 
Memory management
Memory managementMemory management
Memory management
PATELARCH
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
Johan Granados Montero
 
7. Memory management in operating system.ppt
7. Memory management in operating system.ppt7. Memory management in operating system.ppt
7. Memory management in operating system.ppt
imrank39199
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
SandhyaTatekalva
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
Maitree Patel
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
Aisyah Rafiuddin
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
rohassanie
 
Operating System
Operating SystemOperating System
Operating System
Subhasis Dash
 
Memory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptxMemory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptx
KongaMadhukar
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
Amanuelmergia
 
Memory Management in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for all
VSKAMCSPSGCT
 
Chapter07_ds.ppt
Chapter07_ds.pptChapter07_ds.ppt
Chapter07_ds.ppt
AvadhRakholiya3
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
ChethanaThammaiah
 
Introduction to Parallel Computing
Introduction to Parallel ComputingIntroduction to Parallel Computing
Introduction to Parallel Computing
Akhila Prabhakaran
 

Similar to Memory Management (20)

Memory Management
Memory ManagementMemory Management
Memory Management
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Storage management
Storage managementStorage management
Storage management
 
M20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptxM20CA1030_391_2_Part2.pptx
M20CA1030_391_2_Part2.pptx
 
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
 
Memory management
Memory managementMemory management
Memory management
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
7. Memory management in operating system.ppt
7. Memory management in operating system.ppt7. Memory management in operating system.ppt
7. Memory management in operating system.ppt
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process management
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
 
Operating System
Operating SystemOperating System
Operating System
 
Memory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptxMemory Management techniques -ch8_1.pptx
Memory Management techniques -ch8_1.pptx
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Memory Management in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for all
 
Chapter07_ds.ppt
Chapter07_ds.pptChapter07_ds.ppt
Chapter07_ds.ppt
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
 
Introduction to Parallel Computing
Introduction to Parallel ComputingIntroduction to Parallel Computing
Introduction to Parallel Computing
 

More from SanthiNivas

Programming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th SemesterProgramming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th Semester
SanthiNivas
 
Implementing AJAX in PHP. Asynchronous JavaScript and XML
Implementing AJAX in PHP. Asynchronous JavaScript and XMLImplementing AJAX in PHP. Asynchronous JavaScript and XML
Implementing AJAX in PHP. Asynchronous JavaScript and XML
SanthiNivas
 
packages.ppt
packages.pptpackages.ppt
packages.ppt
SanthiNivas
 
exception-handling-in-java.ppt
exception-handling-in-java.pptexception-handling-in-java.ppt
exception-handling-in-java.ppt
SanthiNivas
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
SanthiNivas
 
static methods.pptx
static methods.pptxstatic methods.pptx
static methods.pptx
SanthiNivas
 
Topologies.ppt
Topologies.pptTopologies.ppt
Topologies.ppt
SanthiNivas
 
transmission media.ppt
transmission media.ppttransmission media.ppt
transmission media.ppt
SanthiNivas
 
Internet Basics Presentation.pptx
Internet Basics Presentation.pptxInternet Basics Presentation.pptx
Internet Basics Presentation.pptx
SanthiNivas
 
Topologies.ppt
Topologies.pptTopologies.ppt
Topologies.ppt
SanthiNivas
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptx
SanthiNivas
 
Output Devices.pptx
Output Devices.pptxOutput Devices.pptx
Output Devices.pptx
SanthiNivas
 
Input Devices.pptx
Input Devices.pptxInput Devices.pptx
Input Devices.pptx
SanthiNivas
 
Operating System File Management Unit v.pptx
Operating System File Management Unit v.pptxOperating System File Management Unit v.pptx
Operating System File Management Unit v.pptx
SanthiNivas
 
Input and Output Devices
Input and Output DevicesInput and Output Devices
Input and Output Devices
SanthiNivas
 
HTML
HTMLHTML
DDA ALGORITHM.pdf
DDA ALGORITHM.pdfDDA ALGORITHM.pdf
DDA ALGORITHM.pdf
SanthiNivas
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
SanthiNivas
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
SanthiNivas
 
Page Layout and Background
Page Layout and BackgroundPage Layout and Background
Page Layout and Background
SanthiNivas
 

More from SanthiNivas (20)

Programming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th SemesterProgramming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th Semester
 
Implementing AJAX in PHP. Asynchronous JavaScript and XML
Implementing AJAX in PHP. Asynchronous JavaScript and XMLImplementing AJAX in PHP. Asynchronous JavaScript and XML
Implementing AJAX in PHP. Asynchronous JavaScript and XML
 
packages.ppt
packages.pptpackages.ppt
packages.ppt
 
exception-handling-in-java.ppt
exception-handling-in-java.pptexception-handling-in-java.ppt
exception-handling-in-java.ppt
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
 
static methods.pptx
static methods.pptxstatic methods.pptx
static methods.pptx
 
Topologies.ppt
Topologies.pptTopologies.ppt
Topologies.ppt
 
transmission media.ppt
transmission media.ppttransmission media.ppt
transmission media.ppt
 
Internet Basics Presentation.pptx
Internet Basics Presentation.pptxInternet Basics Presentation.pptx
Internet Basics Presentation.pptx
 
Topologies.ppt
Topologies.pptTopologies.ppt
Topologies.ppt
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptx
 
Output Devices.pptx
Output Devices.pptxOutput Devices.pptx
Output Devices.pptx
 
Input Devices.pptx
Input Devices.pptxInput Devices.pptx
Input Devices.pptx
 
Operating System File Management Unit v.pptx
Operating System File Management Unit v.pptxOperating System File Management Unit v.pptx
Operating System File Management Unit v.pptx
 
Input and Output Devices
Input and Output DevicesInput and Output Devices
Input and Output Devices
 
HTML
HTMLHTML
HTML
 
DDA ALGORITHM.pdf
DDA ALGORITHM.pdfDDA ALGORITHM.pdf
DDA ALGORITHM.pdf
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Page Layout and Background
Page Layout and BackgroundPage Layout and Background
Page Layout and Background
 

Recently uploaded

A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 

Recently uploaded (20)

A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 

Memory Management

  • 1. Operating Systems- Memory management PREPARED BY, V.SANTHI ASSISTANT PROFESSOR, DEPARTMENT OF BCA, BON SECOURS COLLEGE FOR WOMEN, THANJAVUR.
  • 2. Memory management : Early systems Memory Allocation schemes: Single user configurations Fixed Partitions Dynamic Partitions Relocatable Dynamic Partitions
  • 3. • Main memory –temporary memory(RAM) • Secondary memory –Permanent memory(ROM) • Single user contiguous scheme: • Single Contiguous Memory Allocation is a simple memory allocation scheme, • Requires no special hardware features. Entire available memory is allocated to a single job.
  • 4. • In this scheme of allocation, the main memory is divided into 2 contiguous regions. • One portion is permanently allocated to the operating system. All the remaining memory is available for a single job, which has to be processed. The Job actually uses some part of the allocated memory. • Two h/w items need: • 1.Register to store address • 2. Accumulator keep track of the size ,the Program being read into memory • It doesn’t support multiprogramming or N/W, handle one job at a time.
  • 5. • All the computer's memory, usually with, the exception of a small portion reserved for the operating system. • Early years computer were physically large & low memory capacity. • If the program doesn’t fit ,either the main memory must be increased or program must be modified.
  • 6. • Advantage: • 1. Simple Allocation • 2. Entire scheme requires less memory • 3. Easy to implement & use. • Disadvantage: • 1. Memory & CPU not fully Utilized • 2. User program is being limited.
  • 7. • It allow multiprogramming within main memory-one partition for each job. • Each Memory partition was designed when the system power on, and to be reconfigured when the system shut down(Restart). • Protect job’s memory space • Once Partition assigned to a job , no other job will assign to that partition. • Fixed partition allocation ,protection was mandatory for each partitions. • Joint responsibility OS –H/W. Fixed / Static Partitions:
  • 8. • Its better than single contiguous allocation, because it allow several program into main memory at the same time.
  • 9.
  • 10. • Internal fragmentation-drawback • 100k • J1= 75k • 25k • J2=25k • 50k • J3=45k • 25k • J4=23k OS
  • 11. DYNAMIC PARTITION: • Partitions(MM) are created dynamically. • Dynamic partition utilizes the memory when the 1st job load , jobs are not in same size. • It fit into the available space based on priority. (First come – First served bases.). • Memory creates fragment of free memory b/w blocks called external fragmentation. 100k 150k 200k OS
  • 12. Best fit vs First fit: • Best fit: • The best fit deals with allocating the smallest free partition which meets the requirement of the requesting process. This algorithm first searches the entire list of free partitions and considers the smallest hole that is adequate. It then tries to find a hole which is close to actual process size needed. • J1-135k 100k - waiting job • j2-75k 150k =15free • j3-165k 200k =35 free • Disadvantage: upcoming job must be wait till memory to be arrange 75k 165k 75k 135k
  • 13. First fit • In the first fit approach is to allocate the first free partition or hole large enough which can accommodate the process. It finishes after finding the first suitable free partition. • 100k - waiting job • 150k =100free • 200k =150 free J1- 10k J2- 50k J3- 50k J4- 50k
  • 14. Deallocation:100k free50k called de-allocation • Deallocation of memory by the Operating System (OS) is a way to free the Random Access Memory (RAM) of finished processes. New processes are allocated again. This is how the OS works with allocation and deallocation. • In fixed partition- when job is completed memory manager resets the memory block free –to store another job. • 1.when the block to be de-allocated is adjacent(3-free-busy-free) to another free block. • 2.when the block to be de-allocated is b/w two free block. • 3.when the block to be de-allocated is isolated from other free block. J1- 50k J1-50k 50k
  • 15. Null entry: • the status is changed from “a null entry to free” – indicate that a new block of memory is available. • When the null entry found, the beginning memory location of the terminating job is entered in the beginning address column,(1000) • the job size is entered under the memory block size column.
  • 16. Relocatable dynamic partitions: • In relocatable dynamic partition, memory manager in operating system relocates the program, that is all empty blocks are gathered to form one single block of large memory enough to accommodate some or all of the jobs waiting in the queue. • Compaction(defragmentation & garbage collection)- combining all the empty memory spaces together.
  • 17. Compaction • it’s not a easy task, every program memory must be reallocated, so they are contiguous, - every address, every reference to an address within the each program must be adjusted to new location in memory.- OS must be differentiate ADDRESS & DATA VALUE. • All numbers are stored in memory as binary values. • Assembly language instruction to ADD integer 1 to I, • Instruction like ADDI A ,1 ex: (A+1)
  • 18. Flag: • A flag is a value that acts as a signal for a function or process. The value of the flag is used to determine the next step of a program. • Flags are often binary flags, which contain a Boolean value (true or false). However, not all flags are binary, meaning they can store a range of values.
  • 19. After relocation & compaction – free list & busy list updated Show block of free memory show the new location of the job under the process Register: used to relocate the memory 1.Bound Register- store highest/lowest memory location 2.Relocation Register-value must be added to each address referenced in program(correct memory address)
  • 20. It has 3 approach in relocating memory: • One is ->100k -75% used • Balance 25% memory wasted • Second is: compact memory only- constant checking of entry queue • Make jobs were waiting. • 3rd one: • Prescribed amount of time elapsed, if chosen time is too small , system will spend more time on compaction on processing.
  • 21. PAGED MEMORY ALLOCATION: • Before job loaded into memory divided into some parts called page-in memory location its called page frames. • Paged memory allocation – based on dividing each incoming job into pages of equal size- some OS page size is equal size of memory Block size. • Page can be stored in any available page frame in main memory • Operating systems, paging is a memory management scheme -a computer stores and retrieves data from secondary storage for use in main memory. In this scheme, the operating system retrieves data from secondary storage in same-size blocks called pages. • Advantage : storing program is Non-contiguous in Main memory- so its more efficiently use any page of any job
  • 22. • Before executing a program, memory manager prepares it by: 1) Determining the number of pages in the program 2) Locating enough empty “page frames” in main memory 3) Loading all of the program’s page into them(MM). • 1st page contains first instruction. • Last page contains last instruction
  • 23. • job1 divided into 4 pages: page 0,page 1, page 2, page 3, • Total job size: 350bytes, • page 0 - 100 • page 1 - 100 • page 2 - 100 • page 3 – 50 (few job size perfectly fill with page size)so internal fragmentation occurs. • Next job must be wait till job1 ends. • If job is Larger than 1100 bytes it never fit to memory. • It is Non-Contiguous storage.