SlideShare uma empresa Scribd logo
1 de 23
Operating System Memory Management
Memory management is the functionality of an operating system which handles or
manages primary memory. Memory management keeps track of each and every memory
location 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.
Memory management provides protection by using two registers, a base register and a
limit register. The base register holds the smallest legal physical memory address and the
limit register specifies the size of the range. For example, if the base register holds
300000 and the limit register is 1209000, then the program can legally access all
addresses from 300000 through 411999
• Instructions and data to memory addresses can be done in following ways
• Compile time -- When it is known at compile time where the process will
reside, compile time binding is used to generate the absolute code.
• Load time -- When it is not known at compile time where the process will
reside in memory, then the compiler generates re-locatable code.
• Execution time -- If the process can be moved during its execution from one
memory segment to another, then binding must be delayed to be done at run
time
Dynamic Loading
• In dynamic loading, a routine of a program is not loaded until it is
called by the program. All routines are kept on disk in a re-locatable
load format. The main program is loaded into memory and is
executed. Other routines methods or modules are loaded on request.
Dynamic loading makes better memory space utilization and unused
routines are never loaded.
Dynamic Linking
• Linking is the process of collecting and combining various modules of
code and data into a executable file that can be loaded into memory
and executed. Operating system can link system level libraries to a
program. When it combines the libraries at load time, the linking is
called static linking and when this linking is done at the time of
execution, it is called as dynamic linking.
• In static linking, libraries linked at compile time, so program code size
becomes bigger whereas in dynamic linking libraries linked at
execution time so program code size remains smaller.
Logical versus Physical Address Space
• An address generated by the CPU is a logical address whereas
address actually available on memory unit is a physical address.
Logical address is also known a Virtual address.
• Virtual and physical addresses are the same in compile-time and load-
time address-binding schemes. Virtual and physical addresses differ in
execution-time address-binding scheme.
• The set of all logical addresses generated by a program is referred to as a
logical address space. The set of all physical addresses corresponding to these
logical addresses is referred to as a physical address space.
• The run-time mapping from virtual to physical address is done by the memory
management unit (MMU) which is a hardware device. MMU uses following
mechanism to convert virtual address to physical address.
• The value in the base register is added to every address generated by a user
process which is treated as offset at the time it is sent to memory. For
example, if the base register value is 10000, then an attempt by the user to
use address location 100 will be dynamically reallocated to location 10100.
• The user program deals with virtual addresses; it never sees the real
physical addresses.
Swapping
• Swapping is a mechanism in which a process can be swapped temporarily out of main memory to a backing store ,
and then brought back into memory for continued execution.
• Backing store is a usually a hard disk drive or any other secondary storage which fast in access and large enough to
accommodate copies of all memory images for all users. It must be capable of providing direct access to these
memory images.
• Major time consuming part of swapping is transfer time. Total transfer time is directly proportional to the amount
of memory swapped. Let us assume that the user process is of size 100KB and the backing store is a standard hard
disk with transfer rate of 1 MB per second. The actual transfer of the 100K process to or from memory will take
• 100KB / 1000KB per second
• = 1/10 second
• = 100 milliseconds
Continue...
Memory Allocation
• Main memory usually has two partitions
• Low Memory -- Operating system resides in this memory.
• High Memory -- User processes then held in high memory.
• Operating system uses the following memory allocation mechanism
S.N. Memory Allocation Description
1. Single-partition allocation In this type of allocation, relocation-register scheme is used to protect
user processes from each other, and from changing operating-system
code and data. Relocation register contains value of smallest physical
address whereas limit register contains range of logical addresses.
Each logical address must be less than the limit register.
2. Multiple-partition allocation In this type of allocation, main memory is divided into a number of
fixed-sized partitions where each partition should contain only one
process. When a partition is free, a process is selected from the input
queue and is loaded into the free partition. When the process
terminates, the partition becomes available for another process.
Fragmentation
• As processes are loaded and removed from memory, the free
memory space is broken into little pieces. It happens after sometimes
that processes can not be allocated to memory blocks considering
their small size and memory blocks remains unused. This problem is
known as Fragmentation.
• Fragmentation is of two types
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 can not be used.
2. Internal
fragmentation
Memory block assigned to process is bigger. Some portion of memory is left
unused as it can not be used by another process
continue..
• External fragmentation can be reduced by compaction or shuffle
memory contents to place all free memory together in one large
block. To make compaction feasible, relocation should be dynamic.
Paging
• External fragmentation is avoided by using paging technique. Paging
is a technique in which physical memory is broken into blocks of the
same size called pages (size is power of 2, between 512 bytes and
8192 bytes). When a process is to be executed, it's corresponding
pages are loaded into any available memory frames.
• Logical address space of a process can be non-contiguous and a
process is allocated physical memory whenever the free memory
frame is available. Operating system keeps track of all free frames.
Operating system needs n free frames to run a program of size n
pages.
• Address generated by CPU is divided into
• Page number (p) -- page number is used as an index into a page table
which contains base address of each page in physical memory.
• Page offset (d) -- page offset is combined with base address to define
the physical memory address.
Segmentation
• Segmentation is a technique to break memory into logical pieces
where each piece represents a group of related information. For
example ,data segments or code segment for each process, data
segment for operating system and so on. Segmentation can be
implemented using or without using paging.
• Unlike paging, segment are having varying sizes and thus eliminates
internal fragmentation. External fragmentation still exists but to lesser
extent.
• Address generated by CPU is divided into
• Segment number (s) -- segment number is used as an index into a
segment table which contains base address of each segment in
physical memory and a limit of segment.
• Segment offset (o) -- segment offset is first checked against limit
and then is combined with base address to define the physical
memory address.
Operating system memory management

Mais conteúdo relacionado

Mais procurados

Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on SegmentationPriyanka bisht
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Process management in os
Process management in osProcess management in os
Process management in osMiong Lazaro
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process SchedulingShipra Swati
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory managementMukesh Chinta
 
Computer architecture cache memory
Computer architecture cache memoryComputer architecture cache memory
Computer architecture cache memoryMazin Alwaaly
 
Auxiliary memory
Auxiliary memoryAuxiliary memory
Auxiliary memoryYuvrajVyas2
 

Mais procurados (20)

Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Boot process
Boot processBoot process
Boot process
 
Memory management
Memory managementMemory management
Memory management
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Memory management
Memory managementMemory management
Memory management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
operating system structure
operating system structureoperating system structure
operating system structure
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Computer architecture cache memory
Computer architecture cache memoryComputer architecture cache memory
Computer architecture cache memory
 
Auxiliary memory
Auxiliary memoryAuxiliary memory
Auxiliary memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 

Destaque

Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory ManagementAkmal Cikmat
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Managementguest1415ae65
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
Memory management
Memory managementMemory management
Memory managementSlideshare
 
chapter 2 memory and process management
chapter 2 memory and process managementchapter 2 memory and process management
chapter 2 memory and process managementAisyah Rafiuddin
 
Memory Management
Memory ManagementMemory Management
Memory ManagementVisakh V
 
Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...Project Student
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management Shashank Asthana
 
Memory Management | Computer Science
Memory Management | Computer ScienceMemory Management | Computer Science
Memory Management | Computer ScienceTransweb Global Inc
 
Dead Lock In Operating Systems
Dead Lock In Operating SystemsDead Lock In Operating Systems
Dead Lock In Operating Systemstotallooser
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating systemMidhun Sankar
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating systemSara Ali
 

Destaque (20)

Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Memory management
Memory managementMemory management
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
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...Operating System (Scheduling, Input and Output Management, Memory Management,...
Operating System (Scheduling, Input and Output Management, Memory Management,...
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Operating System
Operating SystemOperating System
Operating System
 
Memory Management | Computer Science
Memory Management | Computer ScienceMemory Management | Computer Science
Memory Management | Computer Science
 
Dead Lock In Operating Systems
Dead Lock In Operating SystemsDead Lock In Operating Systems
Dead Lock In Operating Systems
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Chapter 7 - Deadlocks
Chapter 7 - DeadlocksChapter 7 - Deadlocks
Chapter 7 - Deadlocks
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 

Semelhante a Operating system memory management

Memory management
Memory managementMemory management
Memory managementPATELARCH
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxAmanuelmergia
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OSC.U
 
Bab 4
Bab 4Bab 4
Bab 4n k
 
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 in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for allVSKAMCSPSGCT
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment HelpJosephErin
 
Ios103 ios102 iv-operating-system-memory-management_wk4
Ios103 ios102 iv-operating-system-memory-management_wk4Ios103 ios102 iv-operating-system-memory-management_wk4
Ios103 ios102 iv-operating-system-memory-management_wk4Anwal Mirza
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1rohassanie
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxMadhuraK13
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Managementdonny101
 
memory managment on computer science.ppt
memory managment on computer science.pptmemory managment on computer science.ppt
memory managment on computer science.pptfootydigarse
 

Semelhante a Operating system memory management (20)

Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Operating system
Operating systemOperating system
Operating system
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
Memory management
Memory managementMemory management
Memory management
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Bab 4
Bab 4Bab 4
Bab 4
 
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 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
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment Help
 
Ios103 ios102 iv-operating-system-memory-management_wk4
Ios103 ios102 iv-operating-system-memory-management_wk4Ios103 ios102 iv-operating-system-memory-management_wk4
Ios103 ios102 iv-operating-system-memory-management_wk4
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
 
CSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptxCSE2010- Module 4 V1.pptx
CSE2010- Module 4 V1.pptx
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
Memory Management.pdf
Memory Management.pdfMemory Management.pdf
Memory Management.pdf
 
memory managment on computer science.ppt
memory managment on computer science.pptmemory managment on computer science.ppt
memory managment on computer science.ppt
 
CH08.pdf
CH08.pdfCH08.pdf
CH08.pdf
 
Memory Management
Memory ManagementMemory Management
Memory Management
 

Mais de rprajat007

Introduction to Computer Graphics Notes
Introduction to Computer Graphics NotesIntroduction to Computer Graphics Notes
Introduction to Computer Graphics Notesrprajat007
 
Computer Networks for Computer Science Student
Computer Networks for Computer Science StudentComputer Networks for Computer Science Student
Computer Networks for Computer Science Studentrprajat007
 
An introduction to programming
An introduction to programmingAn introduction to programming
An introduction to programmingrprajat007
 
Difference between Micro Economics and Macro Economics
Difference between Micro Economics and Macro EconomicsDifference between Micro Economics and Macro Economics
Difference between Micro Economics and Macro Economicsrprajat007
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Clean india mission
Clean india missionClean india mission
Clean india missionrprajat007
 

Mais de rprajat007 (7)

Introduction to Computer Graphics Notes
Introduction to Computer Graphics NotesIntroduction to Computer Graphics Notes
Introduction to Computer Graphics Notes
 
Computer Networks for Computer Science Student
Computer Networks for Computer Science StudentComputer Networks for Computer Science Student
Computer Networks for Computer Science Student
 
Instruction
InstructionInstruction
Instruction
 
An introduction to programming
An introduction to programmingAn introduction to programming
An introduction to programming
 
Difference between Micro Economics and Macro Economics
Difference between Micro Economics and Macro EconomicsDifference between Micro Economics and Macro Economics
Difference between Micro Economics and Macro Economics
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Clean india mission
Clean india missionClean india mission
Clean india mission
 

Último

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Último (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Operating system memory management

  • 1.
  • 2. Operating System Memory Management Memory management is the functionality of an operating system which handles or manages primary memory. Memory management keeps track of each and every memory location 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. Memory management provides protection by using two registers, a base register and a limit register. The base register holds the smallest legal physical memory address and the limit register specifies the size of the range. For example, if the base register holds 300000 and the limit register is 1209000, then the program can legally access all addresses from 300000 through 411999
  • 3.
  • 4. • Instructions and data to memory addresses can be done in following ways • Compile time -- When it is known at compile time where the process will reside, compile time binding is used to generate the absolute code. • Load time -- When it is not known at compile time where the process will reside in memory, then the compiler generates re-locatable code. • Execution time -- If the process can be moved during its execution from one memory segment to another, then binding must be delayed to be done at run time
  • 5. Dynamic Loading • In dynamic loading, a routine of a program is not loaded until it is called by the program. All routines are kept on disk in a re-locatable load format. The main program is loaded into memory and is executed. Other routines methods or modules are loaded on request. Dynamic loading makes better memory space utilization and unused routines are never loaded.
  • 6. Dynamic Linking • Linking is the process of collecting and combining various modules of code and data into a executable file that can be loaded into memory and executed. Operating system can link system level libraries to a program. When it combines the libraries at load time, the linking is called static linking and when this linking is done at the time of execution, it is called as dynamic linking. • In static linking, libraries linked at compile time, so program code size becomes bigger whereas in dynamic linking libraries linked at execution time so program code size remains smaller.
  • 7. Logical versus Physical Address Space • An address generated by the CPU is a logical address whereas address actually available on memory unit is a physical address. Logical address is also known a Virtual address. • Virtual and physical addresses are the same in compile-time and load- time address-binding schemes. Virtual and physical addresses differ in execution-time address-binding scheme.
  • 8. • The set of all logical addresses generated by a program is referred to as a logical address space. The set of all physical addresses corresponding to these logical addresses is referred to as a physical address space. • The run-time mapping from virtual to physical address is done by the memory management unit (MMU) which is a hardware device. MMU uses following mechanism to convert virtual address to physical address. • The value in the base register is added to every address generated by a user process which is treated as offset at the time it is sent to memory. For example, if the base register value is 10000, then an attempt by the user to use address location 100 will be dynamically reallocated to location 10100. • The user program deals with virtual addresses; it never sees the real physical addresses.
  • 9. Swapping • Swapping is a mechanism in which a process can be swapped temporarily out of main memory to a backing store , and then brought back into memory for continued execution. • Backing store is a usually a hard disk drive or any other secondary storage which fast in access and large enough to accommodate copies of all memory images for all users. It must be capable of providing direct access to these memory images. • Major time consuming part of swapping is transfer time. Total transfer time is directly proportional to the amount of memory swapped. Let us assume that the user process is of size 100KB and the backing store is a standard hard disk with transfer rate of 1 MB per second. The actual transfer of the 100K process to or from memory will take • 100KB / 1000KB per second • = 1/10 second • = 100 milliseconds
  • 11. Memory Allocation • Main memory usually has two partitions • Low Memory -- Operating system resides in this memory. • High Memory -- User processes then held in high memory. • Operating system uses the following memory allocation mechanism
  • 12. S.N. Memory Allocation Description 1. Single-partition allocation In this type of allocation, relocation-register scheme is used to protect user processes from each other, and from changing operating-system code and data. Relocation register contains value of smallest physical address whereas limit register contains range of logical addresses. Each logical address must be less than the limit register. 2. Multiple-partition allocation In this type of allocation, main memory is divided into a number of fixed-sized partitions where each partition should contain only one process. When a partition is free, a process is selected from the input queue and is loaded into the free partition. When the process terminates, the partition becomes available for another process.
  • 13. Fragmentation • As processes are loaded and removed from memory, the free memory space is broken into little pieces. It happens after sometimes that processes can not be allocated to memory blocks considering their small size and memory blocks remains unused. This problem is known as Fragmentation. • Fragmentation is of two types
  • 14. 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 can not be used. 2. Internal fragmentation Memory block assigned to process is bigger. Some portion of memory is left unused as it can not be used by another process
  • 15. continue.. • External fragmentation can be reduced by compaction or shuffle memory contents to place all free memory together in one large block. To make compaction feasible, relocation should be dynamic.
  • 16. Paging • External fragmentation is avoided by using paging technique. Paging is a technique in which physical memory is broken into blocks of the same size called pages (size is power of 2, between 512 bytes and 8192 bytes). When a process is to be executed, it's corresponding pages are loaded into any available memory frames. • Logical address space of a process can be non-contiguous and a process is allocated physical memory whenever the free memory frame is available. Operating system keeps track of all free frames. Operating system needs n free frames to run a program of size n pages.
  • 17. • Address generated by CPU is divided into • Page number (p) -- page number is used as an index into a page table which contains base address of each page in physical memory. • Page offset (d) -- page offset is combined with base address to define the physical memory address.
  • 18.
  • 19.
  • 20. Segmentation • Segmentation is a technique to break memory into logical pieces where each piece represents a group of related information. For example ,data segments or code segment for each process, data segment for operating system and so on. Segmentation can be implemented using or without using paging. • Unlike paging, segment are having varying sizes and thus eliminates internal fragmentation. External fragmentation still exists but to lesser extent.
  • 21.
  • 22. • Address generated by CPU is divided into • Segment number (s) -- segment number is used as an index into a segment table which contains base address of each segment in physical memory and a limit of segment. • Segment offset (o) -- segment offset is first checked against limit and then is combined with base address to define the physical memory address.