4

I have watched this video http://www.markj.net/iphone-memory-debug-nszombie/

The guy shows an option called Enable NSZombie Detection on Allocations inside instruments, but my Instruments doesn't shows this option. This guy's video was done using a one year old version of Instruments and I am using Xcode 3.2.5. Do you guys know where this option is now? How can I enable it for iPhone apps?

thanks

Pete Hodgson
  • 15,644
  • 5
  • 38
  • 46
Duck
  • 34,902
  • 47
  • 248
  • 470

3 Answers3

13

In XCode 4.0, this 'Enable Zombie' option is only present in iPhone simulator and not when you profile on actual device.

8

The zombie option is available in Xcode 3.2.6 under the allocations tool if you run in the simulator. For debugging memory crashes due to too many dealloc, the simulator will work just as well as the device nearly every time. BTW I am 'The guy' in the question ;-)

enter image description here

Mark Johnson
  • 1,105
  • 9
  • 8
  • Ah, you are THE guy!!!! Thanks for the video, but my problem is that my app is running core motion and the simulator will not work for that, and this option will not show if you are debugging on the device. Anyway, thanks. +1 for the video. – Duck Mar 11 '11 at 18:37
  • 1
    Try it with isimulate. I've used it with our open-gl touch screen game and it works great. http://www.vimov.com/isimulate/ – Mark Johnson Mar 15 '11 at 17:36
  • 3
    how about Instruments 4.2 ? I can't find it. – CiNN Jul 21 '11 at 13:22
6

You can find it in Instruments in the Allocations Instrument. The easiest thing to do is to select:

Run -> Run with Performance Tool -> Allocations

This will start the application and Instruments will start recording. However, the Zombie detection may be off. To turn it on, stop the recording, click on the 'i' icon, and check 'Enable NSZombie detection'. Once it is enabled, start the recording again.

It should be noted that in XCode 4.0, one can only enable zombie detect in the simulator, not when running on a device.

ericg
  • 8,413
  • 9
  • 43
  • 77
  • sorry, but this option is not available for iPhone apps, just for mac apps and as I said, the Allocations instrument doesn't have it anymore. – Duck Mar 07 '11 at 15:32
  • You are correct, the menu option for some reason does appear to be available, but I created the default navigation-based ios application, ran it with the Allocations performance tool, clicked on the 'i' icon for the Allocations instrument, and checked 'Enable NSZombie detection'. – ericg Mar 07 '11 at 16:07
  • what version of Xcode are you using? I am using 3.2.5 and my instruments doesn't have this option, what is very strange. – Duck Mar 07 '11 at 20:16
  • 3.2.5 as well. However, the actual feature is in Instruments itself and I am using version 2.7 (3017). I will update my answer and remove the part about the Zombies menu item being available for iOS apps in Xcode. – ericg Mar 07 '11 at 20:34
  • Exactly the same version I am using. Look what I see on the info panel of Allocations... http://imgur.com/QxWgY ... I will accept your answer but I am not sure how I will make this option appear on my Instruments. Anyway, thanks. – Duck Mar 07 '11 at 20:48
  • Check out: http://vimeo.com/20760174 I made a screen recording of what I am seeing. Perhaps you can spot what is different about our setups. Although, it looks like it will take around 3-4 hours for the video to be converted and available. – ericg Mar 07 '11 at 21:13
  • 1
    thanks. Very kind of you doing this video. Watching your video I realized the problem. I am debugging on the device and you are debugging on the simulator. Now I see that this option just shows on the simulator (thanks Apple!). The problem is that my project uses core motion, so I cannot use the simulator. Thanks anyway. I was about to reinstall Xcode. – Duck Mar 08 '11 at 04:12
  • Well, that's annoying. I might suggest heading to http://bugreport.apple.com and asking that they find a way to support Core Motion events in the simulator. I'm sure others have done so and the more requests they get, the greater the odds they will do it...explain why as well - that you need zombie detection. – ericg Mar 08 '11 at 04:23
  • @Digital Robot: I think this answer should not be marked as accepted answer since it's only partially true - as Mark Johnson says below, for iPhone you have to run the app in the simulator to have the option to detect zombies available. OK, I move along now :) – matm Apr 08 '11 at 09:58