SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
Memory Management
UMESHCHANDRA YADAV
ROLL NO.1783910909
2nd
year CSE
Department of Computer Science & Engineering
RAJKIYA ENGINEERING COLLEGE ,KANNAUJ
U.P. 209732
CONTENT
1.INTRODUCTION
2.MEMORY REALLOCATION
3.MEMORY MANGEMENT UNIT
4.SAWPPING
5.PAGGING
6.FRAGMENTATION
7.SEGMENTATION
INTRODUCTION
Memory management refers to management of main
memory address.
An Operating System activities for memory management
1.In multiprogramming, the OS decides which process will get
memory when and how much.
2.Allocates memory when a process requests .
3.De-allocates memory when a process no longer needs it or
has been terminated.
A pair of base and limit registers define the logical address
space
Base and Limit Registers
Multistep Processing of a User Program
Compile time
Hardwire physical location at compile time(absolute code)
Problem
• Each program needs to be written with others in mind
• Not really transparent
Load time
Compiled code relocatable (relocatable code)
How? All addresses relative to a start address. Change start address
to relocate
Problem
• Once loaded, can’t change or move
Execution time
Can move during execution
This is what’s generally done, but need hardware support
When to Relocate?
Logical address – generated by the CPU; also
referred to as virtual address
Physical address – address seen by the memory
unit
Logical and physical addresses are the same in
compile-time and load-time address-binding
schemes.
Logical and physical addresses differ in execution-
time address-binding scheme
Logical vs. Physical Address Space
Contiguous Allocation
Multiple-partition allocation
Hole – block of available memory; holes of various size are scattered
throughout memory
When a process arrives, it is allocated memory from a hole large enough
to accommodate it
Operating system maintains information about:
a) allocated partitions b) free partitions (hole)
OS
process 5
process 8
process 2
OS
process 5
process 2
OS
process 5
process 2
OS
process 5
process 9
process 2
process 9
process 10
Dynamic Storage-Allocation Problem
First-fit: Allocate the first hole that is big enough
Best-fit: Allocate the smallest hole that is big enough;
must search entire list, unless ordered by size
Produces the smallest leftover hole
Worst-fit: Allocate the largest hole; must also search
entire list
Produces the largest leftover hole
How to satisfy a request of size n from a list of free holes
It’s hardware device that maps virtual
to physical address
In MMU scheme, the value in the
relocation register is added to every
address generated by a user process
at the time it is sent to memory
The user program deals with logical
addresses; it never sees the real
physical addresses
Memory-Management Unit (MMU)
SWAPPING
Swapping is a mechanism in which a process can be swapped
temporarily out of main memory (or move) to secondary storage and
make that memory available to other processes.
Paging
Logical address space of a process can be
noncontiguous; process is allocated physical memory
whenever the latter is available
Divide physical memory into fixed-sized blocks called
frames (size is power of 2, between 512 bytes and 8,192
bytes)
Divide logical memory into blocks of same size called
pages
Paging Hardware
Fragmentation
External Fragmentation – total memory space exists to satisfy a
request, but it is not contiguous
Internal Fragmentation – allocated memory may be slightly larger
than requested memory; this size difference is memory internal to a
partition, but not being used
Reduce external fragmentation by compaction
Compaction is possible only if relocation is dynamic, and is done at
execution time
Segmentation
Memory-management scheme that supports user view of memory
A program is a collection of segments
A segment is a logical unit such as:
main program
procedure
function
method
object
local variables, global variables
common block
stack
symbol table
arrays
Logical View of Segmentation
1
3
2
4
1
4
2
3
user space
physical memory space
Segmentation Architecture
Logical address consists of a two tuple:
<segment-number, offset>
Segment table – maps two-dimensional physical addresses; each
table entry has:
base – contains the starting physical address where the segments
reside in memory
limit – specifies the length of the segment
Segment-table base register (STBR) points to the segment table’s
location in memory
Segment-table length register (STLR) indicates number of
segments used by a program;
Segmentation Hardware
THANK YOU

Más contenido relacionado

La actualidad más candente

8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management Maitree Patel
 
9 virtual memory management
9 virtual memory management9 virtual memory management
9 virtual memory managementDr. Loganathan R
 
Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentationRanjeet Kumar
 
Memory allocation (4)
Memory allocation (4)Memory allocation (4)
Memory allocation (4)rockymani
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 
Parallel Programing Model
Parallel Programing ModelParallel Programing Model
Parallel Programing ModelAdlin Jeena
 
Memory organization
Memory organizationMemory organization
Memory organizationAL- AMIN
 
Paging and Segmentation
Paging and SegmentationPaging and Segmentation
Paging and SegmentationMadhur Gupta
 

La actualidad más candente (20)

Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Memory management
Memory managementMemory management
Memory management
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
 
9 virtual memory management
9 virtual memory management9 virtual memory management
9 virtual memory management
 
Cache memory
Cache memoryCache memory
Cache memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentation
 
Memory allocation (4)
Memory allocation (4)Memory allocation (4)
Memory allocation (4)
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Parallel Programing Model
Parallel Programing ModelParallel Programing Model
Parallel Programing Model
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
Memory organization
Memory organizationMemory organization
Memory organization
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Memory management
Memory managementMemory management
Memory management
 
Memory hierarchy
Memory hierarchyMemory hierarchy
Memory hierarchy
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
 
Paging and Segmentation
Paging and SegmentationPaging and Segmentation
Paging and Segmentation
 

Similar a Memory management OS

Similar a Memory management OS (20)

Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
Bab 4
Bab 4Bab 4
Bab 4
 
Chapter 8 : Memory
Chapter 8 : MemoryChapter 8 : Memory
Chapter 8 : Memory
 
Ch8
Ch8Ch8
Ch8
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
 
CH08.pdf
CH08.pdfCH08.pdf
CH08.pdf
 
CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3
 
Operating System
Operating SystemOperating System
Operating System
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
OS Unit 2.pptx
OS Unit 2.pptxOS Unit 2.pptx
OS Unit 2.pptx
 
Chapter 8 memory-updated
Chapter 8 memory-updatedChapter 8 memory-updated
Chapter 8 memory-updated
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptx
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 

Último

Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 

Último (20)

Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 

Memory management OS

  • 1. Memory Management UMESHCHANDRA YADAV ROLL NO.1783910909 2nd year CSE Department of Computer Science & Engineering RAJKIYA ENGINEERING COLLEGE ,KANNAUJ U.P. 209732
  • 2. CONTENT 1.INTRODUCTION 2.MEMORY REALLOCATION 3.MEMORY MANGEMENT UNIT 4.SAWPPING 5.PAGGING 6.FRAGMENTATION 7.SEGMENTATION
  • 3. INTRODUCTION Memory management refers to management of main memory address. An Operating System activities for memory management 1.In multiprogramming, the OS decides which process will get memory when and how much. 2.Allocates memory when a process requests . 3.De-allocates memory when a process no longer needs it or has been terminated.
  • 4. A pair of base and limit registers define the logical address space Base and Limit Registers
  • 5. Multistep Processing of a User Program
  • 6. Compile time Hardwire physical location at compile time(absolute code) Problem • Each program needs to be written with others in mind • Not really transparent Load time Compiled code relocatable (relocatable code) How? All addresses relative to a start address. Change start address to relocate Problem • Once loaded, can’t change or move Execution time Can move during execution This is what’s generally done, but need hardware support When to Relocate?
  • 7. Logical address – generated by the CPU; also referred to as virtual address Physical address – address seen by the memory unit Logical and physical addresses are the same in compile-time and load-time address-binding schemes. Logical and physical addresses differ in execution- time address-binding scheme Logical vs. Physical Address Space
  • 8. Contiguous Allocation Multiple-partition allocation Hole – block of available memory; holes of various size are scattered throughout memory When a process arrives, it is allocated memory from a hole large enough to accommodate it Operating system maintains information about: a) allocated partitions b) free partitions (hole) OS process 5 process 8 process 2 OS process 5 process 2 OS process 5 process 2 OS process 5 process 9 process 2 process 9 process 10
  • 9. Dynamic Storage-Allocation Problem First-fit: Allocate the first hole that is big enough Best-fit: Allocate the smallest hole that is big enough; must search entire list, unless ordered by size Produces the smallest leftover hole Worst-fit: Allocate the largest hole; must also search entire list Produces the largest leftover hole How to satisfy a request of size n from a list of free holes
  • 10. It’s hardware device that maps virtual to physical address In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory The user program deals with logical addresses; it never sees the real physical addresses Memory-Management Unit (MMU)
  • 11. SWAPPING Swapping is a mechanism in which a process can be swapped temporarily out of main memory (or move) to secondary storage and make that memory available to other processes.
  • 12. Paging Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter is available Divide physical memory into fixed-sized blocks called frames (size is power of 2, between 512 bytes and 8,192 bytes) Divide logical memory into blocks of same size called pages
  • 14. Fragmentation External Fragmentation – total memory space exists to satisfy a request, but it is not contiguous Internal Fragmentation – allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used Reduce external fragmentation by compaction Compaction is possible only if relocation is dynamic, and is done at execution time
  • 15. Segmentation Memory-management scheme that supports user view of memory A program is a collection of segments A segment is a logical unit such as: main program procedure function method object local variables, global variables common block stack symbol table arrays
  • 16. Logical View of Segmentation 1 3 2 4 1 4 2 3 user space physical memory space
  • 17. Segmentation Architecture Logical address consists of a two tuple: <segment-number, offset> Segment table – maps two-dimensional physical addresses; each table entry has: base – contains the starting physical address where the segments reside in memory limit – specifies the length of the segment Segment-table base register (STBR) points to the segment table’s location in memory Segment-table length register (STLR) indicates number of segments used by a program;