SlideShare une entreprise Scribd logo
1  sur  27
RUN-TIME
ENVIRONMENTSHEAP MANAGAGEMENT
HEAP
- portion of the store used for data that lives
indefinitely or until explicitly deleted by the
program
Nevermore by Paul
Gaugin
MEMORY MANAGER
 the subsystem that allocates and
deallocates space within the heap
 keeps track of all the free space in heap
storage at all times
 serves as an interface between
application programs and the operating
system
MEMORY MANAGER
 produces a chunk of contiguous heap
memory of the requested size
 if no chunk of the needed size is
available, it increases the heap storage
by getting consecutive bytes of virtual
memory from the OS
ALLOCATION
MEMORY
ALLOCATION
 returns deallocated space to the pool of
free space (so it can reuse the space)
 typically does not return memory to the
OS, even if heap usage drops
DEALLOCATION
MEMORY
ALLOCATION
 Space Efficiency
 Program Efficiency
 Low Overhead
MEMORY MANAGER
WINTERTemplate
MEMORY
HIERARCHY
01
02
Register
1st-Level
Cache
2nd-Level Cache
Physical Memory
Virtual Memory (Disk)
Memory Diagram
Typical Sizes
32 Words
16 - 64KB
128KB - 4MB
256MB - 2GB
> 2GB
Typical Access Times
1 ns
5 - 10 ns
40 - 60 ns
100 - 150 ns
3 - 15 ms
02Memory Diagram
Register
1st-Level
Cache
2nd-Level Cache
Physical Memory
Virtual Memory (Disk)
The goal is to obtain
the best average
access speed while
minimizing the total
cost of the entire
memory system.
03Principle of Locality
Also known as Locality of Reference
The phenomenon of the same value or
related storage locations being frequently
accessed.
90/10 Rule comes
from the empirical
observation:
“A program spends
90% of its time in
10% of its code.”
03
Two Types of Access Locality
1. Temporal Locality
2. Spatial Locality
Principle of Locality
03
1. Temporal Locality
the memory locations the program
accesses are likely to be accessed again
within a short period of time
Principle of Locality
Example: Instruction in the
body of inner loops
03
2. Spatial Locality
memory locations close to the location
accessed are likely also to be accessed
within a short period of time
Principle of Locality
Example: Traversing the
elements in a one-dimentional
array
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition,
Reducing Fragmentation
8.16 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
CONTIGUOUS MEMORY
8.17 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Contiguous Allocation
 Main memory usually into two partitions:
 Resident operating system, usually held in low memory
with interrupt vector
 User processes then held in high memory
8.18 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
Contiguous 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
8.19 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition
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
 Coalescing
REDUCING FRAGMENTATION
COALESCING
- combining adjacent chunks of the heap to
form a larger chunk
 Boundary Tags
- keeping a free/used bit at both ends of each
chunk
- adjacent to the free/used bit is a count of
the # of bytes
 Doubly Linked, Imbedded Free List
- free chunks are linked in a doubly linked list
- chunks must accommodate two boundary
tags and two pointers
COALESCING
REDUCING
FRAGMENTATION
MANUAL DEALLOCATION
REQUEST
 Memory-leak Error
- failing to EVER delete data that cannot be
referenced
 Dangling-pointer-dereference
[note: dangling pointers - pointers to storage that
has
been deallocated]
- referencing deleted data
MANUAL DEALLOCATION
REQUESTS
 Object Ownership
- associate an owner with each object (e.g.
functions and their variables)
 Reference Counting
- associate a count with each dynamically
allocated object
PROGRAMMING CONVENTIONS &
TOOLS
MANUAL DEALLOCATION
REQUESTS
 Region-based Allocation
- allocate all objects in the same region; then
delete the entire region
PROGRAMMING CONVENTIONS &
TOOLS
MANUAL DEALLOCATION
REQUESTS
Fin.

Contenu connexe

Tendances

Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methodsajeela mushtaq
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Issues in design_of_code_generator
Issues in design_of_code_generatorIssues in design_of_code_generator
Issues in design_of_code_generatorvinithapanneer
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazationSiva Sathya
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignKuppusamy P
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler designAnul Chaudhary
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignmentKarthi Keyan
 
Passes of compilers
Passes of compilersPasses of compilers
Passes of compilersVairavel C
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in clavanya marichamy
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler designSudip Singh
 
Directed Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksDirected Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksMohammad Vaseem Akaram
 

Tendances (20)

Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
 
Unit iv(simple code generator)
Unit iv(simple code generator)Unit iv(simple code generator)
Unit iv(simple code generator)
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Issues in design_of_code_generator
Issues in design_of_code_generatorIssues in design_of_code_generator
Issues in design_of_code_generator
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
Peephole Optimization
Peephole OptimizationPeephole Optimization
Peephole Optimization
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
Chapter 5 Syntax Directed Translation
Chapter 5   Syntax Directed TranslationChapter 5   Syntax Directed Translation
Chapter 5 Syntax Directed Translation
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Passes of compilers
Passes of compilersPasses of compilers
Passes of compilers
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in c
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler design
 
Assembler
AssemblerAssembler
Assembler
 
Directed Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksDirected Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocks
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 

Similaire à Heap Management

Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)Prashanth Kumar
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptinfomerlin
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Managementdonny101
 
ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxAnamRiaz31
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cacheVISHAL DONGA
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OSC.U
 
Memory allocation for real time operating system
Memory allocation for real time operating systemMemory allocation for real time operating system
Memory allocation for real time operating systemAsma'a Lafi
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1rohassanie
 
Bab 4
Bab 4Bab 4
Bab 4n k
 
Linux memorymanagement
Linux memorymanagementLinux memorymanagement
Linux memorymanagementpradeepelinux
 
Google File System
Google File SystemGoogle File System
Google File SystemDreamJobs1
 
Heap Memory Management.pptx
Heap Memory Management.pptxHeap Memory Management.pptx
Heap Memory Management.pptxViji B
 

Similaire à Heap Management (20)

Operating System
Operating SystemOperating System
Operating System
 
Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptx
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Memory allocation for real time operating system
Memory allocation for real time operating systemMemory allocation for real time operating system
Memory allocation for real time operating system
 
CH08.pdf
CH08.pdfCH08.pdf
CH08.pdf
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Bab 4
Bab 4Bab 4
Bab 4
 
Linux memorymanagement
Linux memorymanagementLinux memorymanagement
Linux memorymanagement
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3
 
Main Memory
Main MemoryMain Memory
Main Memory
 
Google File System
Google File SystemGoogle File System
Google File System
 
Heap Memory Management.pptx
Heap Memory Management.pptxHeap Memory Management.pptx
Heap Memory Management.pptx
 
Memory management OS
Memory management OSMemory management OS
Memory management OS
 
Main memory-2 (ch8,os)
Main memory-2 (ch8,os)Main memory-2 (ch8,os)
Main memory-2 (ch8,os)
 

Plus de Jenny Galino

Basic Blocks and Flow Graphs
Basic Blocks and Flow GraphsBasic Blocks and Flow Graphs
Basic Blocks and Flow GraphsJenny Galino
 
Genetically Modified Food
Genetically Modified FoodGenetically Modified Food
Genetically Modified FoodJenny Galino
 
Hierarchical Memory System
Hierarchical Memory SystemHierarchical Memory System
Hierarchical Memory SystemJenny Galino
 

Plus de Jenny Galino (7)

Basic Blocks and Flow Graphs
Basic Blocks and Flow GraphsBasic Blocks and Flow Graphs
Basic Blocks and Flow Graphs
 
Semantic Networks
Semantic NetworksSemantic Networks
Semantic Networks
 
Upper OSI Layers
Upper OSI LayersUpper OSI Layers
Upper OSI Layers
 
Genetically Modified Food
Genetically Modified FoodGenetically Modified Food
Genetically Modified Food
 
Geometry
GeometryGeometry
Geometry
 
Hierarchical Memory System
Hierarchical Memory SystemHierarchical Memory System
Hierarchical Memory System
 
Knapsack Problem
Knapsack ProblemKnapsack Problem
Knapsack Problem
 

Dernier

Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsDeira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsEscorts Call Girls
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointGetawu
 
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Pooja Nehwal
 
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...MOHANI PANDEY
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...motiram463
 
Lubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabtLubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabtdineshkumar430venkat
 
VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...Call Girls in Nagpur High Profile
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...Pooja Nehwal
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...Call Girls in Nagpur High Profile
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 

Dernier (20)

Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsDeira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power point
 
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
 
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
Lubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabtLubrication and it's types and properties of the libricabt
Lubrication and it's types and properties of the libricabt
 
@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls
@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls
@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls
 
VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Karve Nagar (7001035870) Pune Escorts Nearby with Comple...
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
🔝 9953056974🔝 Delhi Call Girls in Ajmeri Gate
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 

Heap Management

  • 2. HEAP - portion of the store used for data that lives indefinitely or until explicitly deleted by the program Nevermore by Paul Gaugin
  • 4.  the subsystem that allocates and deallocates space within the heap  keeps track of all the free space in heap storage at all times  serves as an interface between application programs and the operating system MEMORY MANAGER
  • 5.  produces a chunk of contiguous heap memory of the requested size  if no chunk of the needed size is available, it increases the heap storage by getting consecutive bytes of virtual memory from the OS ALLOCATION MEMORY ALLOCATION
  • 6.  returns deallocated space to the pool of free space (so it can reuse the space)  typically does not return memory to the OS, even if heap usage drops DEALLOCATION MEMORY ALLOCATION
  • 7.  Space Efficiency  Program Efficiency  Low Overhead MEMORY MANAGER
  • 9. 02 Register 1st-Level Cache 2nd-Level Cache Physical Memory Virtual Memory (Disk) Memory Diagram Typical Sizes 32 Words 16 - 64KB 128KB - 4MB 256MB - 2GB > 2GB Typical Access Times 1 ns 5 - 10 ns 40 - 60 ns 100 - 150 ns 3 - 15 ms
  • 10. 02Memory Diagram Register 1st-Level Cache 2nd-Level Cache Physical Memory Virtual Memory (Disk) The goal is to obtain the best average access speed while minimizing the total cost of the entire memory system.
  • 11. 03Principle of Locality Also known as Locality of Reference The phenomenon of the same value or related storage locations being frequently accessed. 90/10 Rule comes from the empirical observation: “A program spends 90% of its time in 10% of its code.”
  • 12. 03 Two Types of Access Locality 1. Temporal Locality 2. Spatial Locality Principle of Locality
  • 13. 03 1. Temporal Locality the memory locations the program accesses are likely to be accessed again within a short period of time Principle of Locality Example: Instruction in the body of inner loops
  • 14. 03 2. Spatial Locality memory locations close to the location accessed are likely also to be accessed within a short period of time Principle of Locality Example: Traversing the elements in a one-dimentional array
  • 15. Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition, Reducing Fragmentation
  • 16. 8.16 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition CONTIGUOUS MEMORY
  • 17. 8.17 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Contiguous Allocation  Main memory usually into two partitions:  Resident operating system, usually held in low memory with interrupt vector  User processes then held in high memory
  • 18. 8.18 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition Contiguous 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
  • 19. 8.19 Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8th Edition 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
  • 21. COALESCING - combining adjacent chunks of the heap to form a larger chunk
  • 22.  Boundary Tags - keeping a free/used bit at both ends of each chunk - adjacent to the free/used bit is a count of the # of bytes  Doubly Linked, Imbedded Free List - free chunks are linked in a doubly linked list - chunks must accommodate two boundary tags and two pointers COALESCING REDUCING FRAGMENTATION
  • 24.  Memory-leak Error - failing to EVER delete data that cannot be referenced  Dangling-pointer-dereference [note: dangling pointers - pointers to storage that has been deallocated] - referencing deleted data MANUAL DEALLOCATION REQUESTS
  • 25.  Object Ownership - associate an owner with each object (e.g. functions and their variables)  Reference Counting - associate a count with each dynamically allocated object PROGRAMMING CONVENTIONS & TOOLS MANUAL DEALLOCATION REQUESTS
  • 26.  Region-based Allocation - allocate all objects in the same region; then delete the entire region PROGRAMMING CONVENTIONS & TOOLS MANUAL DEALLOCATION REQUESTS
  • 27. Fin.