Title: Memory Management
1Memory Management
Kathryn McKinley University of Texas at Austin
2About me
3Software for Software
Program
Compiler translates human format to computer
format
Executable
Computer
Runtime System Software
4Whats Inside?
5IBM Power4 Microprocessor
Only 12 of Non-Cache, Non-TLB Core Area is
Execution Units
6Memory System Organization
Registers
Instruction Cache
CPU Central Processing Unit
Level 2 Cache
Data Cache
Memory
7Software for Software
Program
Compiler translates human format to computer
format
Executable
Computer
Runtime System Software
8Eating
- Do forever
- Prepare meal
- Select plates, bowls, silverware
- Serve food Eat
- You wash your dishes
- Explicit Memory Management
9Select Plates, Bowls, Silverware
10Select Plates, Bowls, Silverware
11Explicit Memory ManagementHand Wash Dishes
12Explicit Memory ManagementHandwashing
13Explicit Memory ManagementHand Wash Dishes
14Explicit Memory ManagementHandwashing
15Explicit Memory ManagementHand Wash Dishes
16Dish Washer Automatic Memory ManagementGarbage
Collection
- Do forever
- Prepare meal
- Select plates, bowls, silverware
- Serve food Eat
- Dad put dishes in dishwasher
- Dad checks if dishwasher full or
- Out of plates, bowls or silverware
- Dad runs dishwasher
17Select Plates, Bowls, Silverware
18Select Plates, Bowls, Silverware
19Dad Runs Dish Washer Puts Up Dishes
20Computer Resources
Page
Memory
21Mapping Dishes to Computer Resources
Data Structure Declarations
22Contiguous Allocation
New (Plate1)
23Contiguous Allocation
New (Plate1) New (Plate2) New (Bowl1) New
(Fork1) New (Fork2) New (Spoon1)
24Contiguous Allocation
etc.
25Explicit Memory ManagementFree with Continuous
Allocation
Free (Bowl3)
26Free with Contiguous Allocation
Free (Bowl3) Free (Spoon1)
27Garbage Collection(Automatic Memory Management)
with Contiguous Allocation
Wait longer
28Garbage Collection with Contiguous Allocation
L
L
Find live objects L
L
L
29Garbage Collection with Contiguous Allocation
Find live objects L Copy live objects to new area
L
30Garbage Collection with Contiguous Allocation
Find live objects L Copy live objects to new
area Reclaim old space
L
31Garbage Collection with Contiguous Allocation
Find live objects L Copy them to new
area Reclaim old space Allocate into new space
32Allocation withSize-Class Free-Lists
33Explicit Memory ManagementFree with
Size-Classes Free-Lists
Free (Bowl3) Free (Spoon1)
34Memory Management
- All memory management uses one of these two basic
mechanisms - Contiguous allocation
- Size-Class Free-Lists
- Classic Computer Science Problem in Space-Time
tradeoff
35Other Key Ideas in Memory Management
- Locality
- Incrementality
- Generational behavior
- Older-first behavior
- My research group introduced this one!
36Questions?