Skip to content

Instantly share code, notes, and snippets.

@samkrishna
Last active December 14, 2015 12:18
Show Gist options
  • Save samkrishna/5085375 to your computer and use it in GitHub Desktop.
Save samkrishna/5085375 to your computer and use it in GitHub Desktop.
I wish I could remember how memory is supposed to work....

The jump to ARC and blocks has been a lot more treacherous than the promise the ARC announcement originally had back in June 2011.

Mike Ash gets us started with stacks vs. heaps.

Basic ARC retain cycles also comes up, especially with the infamous retain-self-from-a-block bug.

There's the whole stacks v. heaps challenge again for blocks.

It's just a bitch. My memory about memory is just such a bitch.

UPDATE: I found a VERY COOL SITE for memory and ARC issues (specifically oriented around migrations). Still very useful.

Another notion has been to think of memory as an object graph, but from the POV of memory optimization and cleanup. I wonder if there's a tool out there for memory graph inspections in Objective-C codebases?

UPDATE 2: Apple's POV on the subject of advanced memory management has me thinking in terms of object graphs now. Especially in relation to blocks. However, it's useful to not blindly trust the DEBB.

UPDATE 3: (From Josh Johnson:) Objective-C Blocks quiz if you're feeling it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment