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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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 4
II. Why Automatic Memory Management?
Background image of page 5

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

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

Page1 / 19

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

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

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