l14-handout

l14-handout - Lecture 14 Introduction to Garbage Collection...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lecture 14 Introduction to Garbage Collection I. Memory Management II. Why is Automatic GC Important and Hard? III. Reference Counting IV. Basic Trace-Based GC V. Copying Collectors Readings: Chapter 7.4-7.6.4 M. Lam CS243: Intro to Garbage Collection 1 I. Basic Memory Management Tasks of memory manager: keep track of free space and respond to malloc and free Starting point : One large contiguous space alloc : find big enough hole, get space from OS if necessary decide where to allocate, creates small holes if not a perfect fit free : coalesce adjacent free space to create larger space M. Lam CS243: Intro to Garbage Collection 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Allocation Algorithm Performance consideration Space efficiency too many small holes that cannot be used Time dominated by allocations of small chunks (cost of large chunk amortized by more computation) Spatial locality more compact is better (best if all space is coalesced) Algorithms best fit: best utilization next fit: improves spatial locality because consecutively allocated data tend to have similar life times M. Lam CS243: Intro to Garbage Collection 3 Two Data Structures Boundary tags (for coalescing) Doubly-linked embedded list (for keeping space in ascending-size order) M. Lam CS243: Intro to Garbage Collection 4
Background image of page 2
3 II. Why Automatic Memory Management?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 03/12/2012.

Page1 / 10

l14-handout - Lecture 14 Introduction to Garbage Collection...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online