Question

Is there any danger in compiling an application for distribution with NSZombie still enabled? I generally leave it turned on for all of my apps while developing because of how useful it is, but I don't understand the full ramifications and potential issues related to enabling it and leaving it on indefinitely.

Thanks!

Was it helpful?

Solution

If you leave it on, your application will not release all the memory used, so over time, your application will use up all the RAM on the device and be killed by the OS.

Why would you leave it on if you aren't actually looking for for a memory leak?

OTHER TIPS

It's not a compile option. It's an environment variable. There is no danger leaving it on, because it is not part of the application bundle you will release.

It does make it impossible to find leaks, so you might not want to leave it enabled.

Absolutely. With NSZombie, no memory can be freed, ever. Deallocated objects just turn into zombies. Eventually, after your pile of zombies gets big enough, your app will crash from memory exhaustion.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top