Shoot the Heap
Ah, the joys of non-garbage-collected languages. I spent some time debugging a retain cycle today and thought I’d share the process I used to locate and fix the cycle. Along the way, we’ll see how the Leaks instrument is a dirty filthy liar, watch as Xcode inexplicably mixes old and new code into the same binary yielding impossible behavior, and finally figure out how to use heap shots (or as the new Allocations instrument calls them Generations) to find the retain cycle even in the midst of a retain/release history thousands of entries long.