Download Garbage Collection Programming Guide (Retired

Transcript
Contents
Introduction to Garbage Collection 6
Who Should Read This Document? 6
Organization of This Document 6
See Also 7
Garbage Collection for Cocoa Essentials 8
Basic Concepts 8
How the Garbage Collector Works 8
Root Set and Reference Types 9
Enabling Garbage Collection 10
Foundation Tools 11
Design Patterns to Use, and to Avoid 12
Finalizing objects 12
Don't manage scarce resources with object lifecycle 12
Nib files 12
Triggering garbage collection 13
Threading 13
Prune caches 13
Avoid allocating large numbers of short-lived objects 13
Compile GC-Only 13
C++ 13
Adopting Garbage Collection 14
Advantages and Disadvantages 14
Performance 15
Architecture 17
Motivation and Design Goals 17
High-Level Architecture 20
How the Garbage Collector Works 20
Closed vs. Open Systems 22
Write Barriers 22
What Does a Write-Barrier Do? 23
Write-Barrier Implementation 23
Retired Document | 2012-07-23 | Copyright © 2012 Apple Inc. All Rights Reserved.
2