Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part 2: Translating Technologies > Garbage Collection

Chapter 9. Garbage Collection

Garbage object collection is most notable for what you, the programmer, don't have to do. In a perfect world, you just ignore the mechanics of garbage collection and let the run time system take care of the details. But there are situations when you do need to pay attention to garbage collection. Weak references and finalize methods require some understanding of what causes objects to become garbage and how they get collected.

Garbage collection in Objective-C 2.0 is broadly similar to what you experience in Java. Most of the time, you simply forget about it and "just works." Objective-C's garbage collector is on a par with modern Java implementations. It's a conservative, multi-generational, garbage collector that runs in the background on a separate thread. It handles all of the typical programming problems, like circular references, with aplomb. It's efficient, and rarely gets in the way of your application.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint