Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Instruments - Zombies - what am I looking for?

When I run Project/Profile in Xcode and choose "Zombies", the app runs in the simulator with "NSZombie detection" enabled. But what should I be looking for to tell me that there is a problem? All I see is the Allocation instrument running and the statistics below. Where will it actually show me that a Zombie was detected?

like image 316
soleil Avatar asked Aug 23 '12 19:08

soleil


People also ask

How do I find zombie objects in Xcode?

To confirm it enable zombies in product -> Edit Schemes -> Diagnostics , enable the check mark for Zombie objects.

What are zombie objects?

Zombie objects are a debugging feature of Cocoa / CoreFoundation to help you catch memory errors - normally when an object's refcount drops to zero it's freed immediately, but that makes debugging difficult.

What are zombie objects in Swift?

Overview. Once an Objective-C or Swift object no longer has any strong references to it, the object is deallocated. Attempting to further send messages to the object as if it were still a valid object is a “use after free” issue, with the deallocated object still receiving messages called a zombie object.

How do you enable objects in zombies?

You need to open the Product menu in the Xcode, select Edit scheme and then choose the Diagnostics tab. There you have "Enable Zombie Objects". Once selected and run in debugger will point you to the double released object! Enjoy!


1 Answers

You will get the leak above the object allocation bar. Check this image; enter image description here

For a reference, check this video

like image 94
Midhun MP Avatar answered Sep 29 '22 08:09

Midhun MP