0

I'm currently migrating the Fragaria framework from a GC-only environment to GC being supported. After the work was done (or what I thought had to be done to make it work) I was able to run the examples that come with the framework without any problems and Instruments didn't show any major memory leaks.

I included non-GC Fragaria in my non-GC application and it crashes as soon as I place the cursor on it. To be honest the usage pattern is different from the examples as I'm embedding it in an instance of NSViewController instead of NSDocument.

Can you give me some tips on how to debug this? I'm a bit lost on where to proceed now.

2
  • Memory leaks and crashes are two nearly opposite things. Your app crashes when (among other things) you release something you shouldn't. It leaks memory when you don't release something you should. The Zombies template in Instruments will help with over-release crashes; the Leaks template will help with under-release leaks. Commented Mar 21, 2011 at 8:26
  • The code I committed was admittedly incomplete. Zombies set me on the right path, despite not being the only problem with my version of the framework. Commented Mar 22, 2011 at 22:59

1 Answer 1

2

First thing to do is Build and Analyze the code, then fix any problems it finds.

Next, try running with Zombie detection enabled (google NSZombie).

Finally, each crash's stacktrace should give you a pretty good idea where things have gone off the rails.

Sign up to request clarification or add additional context in comments.

2 Comments

Instruments's Zombies template is easier to use than NSZombieEnabled, since Instruments lets you look into the zombie object's history. With NSZombieEnabled, all you can do is use the debugger, which only shows you the present, not the past.
This was exactly what I needed. Well on my way to plug a serious number of memory leaks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.