SlideShare uma empresa Scribd logo
1 de 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.

Mais conteúdo relacionado

Mais procurados

Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented CommunicationDilum Bandara
 
Three Address code
Three Address code Three Address code
Three Address code Pooja Dixit
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesionSutha31
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network securitybabak danyal
 
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMIEvolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMInimmik4u
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generatorsanchi29
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Project control and process instrumentation
Project control and process instrumentationProject control and process instrumentation
Project control and process instrumentationKuppusamy P
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Hardware and Software parallelism
Hardware and Software parallelismHardware and Software parallelism
Hardware and Software parallelismprashantdahake
 

Mais procurados (20)

Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Taxonomy for bugs
Taxonomy for bugsTaxonomy for bugs
Taxonomy for bugs
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
Three Address code
Three Address code Three Address code
Three Address code
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Tree pruning
 Tree pruning Tree pruning
Tree pruning
 
Common Standards in Cloud Computing
Common Standards in Cloud ComputingCommon Standards in Cloud Computing
Common Standards in Cloud Computing
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Compiler Design Unit 4
Compiler Design Unit 4Compiler Design Unit 4
Compiler Design Unit 4
 
Peephole Optimization
Peephole OptimizationPeephole Optimization
Peephole Optimization
 
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMIEvolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Project control and process instrumentation
Project control and process instrumentationProject control and process instrumentation
Project control and process instrumentation
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
Hardware and Software parallelism
Hardware and Software parallelismHardware and Software parallelism
Hardware and Software parallelism
 

Semelhante a 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
 

Semelhante a 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)
 

Mais 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
 

Mais 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
 

Último

Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Pooja Nehwal
 
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service ThanePooja Nehwal
 
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...Pooja Nehwal
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power pointchhavia330
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...Pooja Nehwal
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gapedkojalkojal131
 
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样qaffana
 
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikLow Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
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 Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一zul5vf0pq
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查awo24iot
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhisoniya singh
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Pooja Nehwal
 
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
 

Último (20)

Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
 
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
 
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service -  Bandra F...
WhatsApp 9892124323 ✓Call Girls In Khar ( Mumbai ) secure service - Bandra F...
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power point
 
🔝 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
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
 
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
 
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikLow Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
 
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
 
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 Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
定制加拿大滑铁卢大学毕业证(Waterloo毕业证书)成绩单(文凭)原版一比一
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
 
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 ...
 

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.