Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-20-2011, 09:04 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 7
springfieldx is on a distinguished road
Post A bit attention about NSZombieEnabled

As a developer, we often need to resolve the memory problems in our apps. One of those is about over release. This situation occurs when sending a release message to the object which "retain count" has already been 0. But as default, the debug message of that error is hard to find the reason of the problem. So, iOS provide an environment variable which name is "NSZombieEnabled". When you set it to YES, you will see the detail information about any over release errors.

Although, most of us has already known this variable and use it frequently. However, we also need to understand the principle behind it. In short, when a object been released, the memory it taken will be cleaned. So, the system can not figure out any information about that object when we send a message after it been released. This is the reason that we can not get any detail error information after the memory been cleaned.

For that reason, iOS provide an mechanism that do not actually clean the memory after the release method been called. That is the real work NSZombleEnabled do. At that condition, the object's memory will not been cleaned even if it "retain count" decreased to 0. The memory have been reserved. So, when an error like "over release" occurs, the system can figure out the detail information about this error.

Because NSZombieEnabled will reserve any memory we taken. So, we must disable it when we finally complete our development progress. If not, our apps will take much memory and not actually release any memory it taken.
springfieldx is offline   Reply With Quote
Reply

Bookmarks

Tags
memory, memory management

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 406
15 members and 391 guests
7twenty7, blasterbr, buggen, Clouds, dre, EvilElf, HemiMG, jeroenkeij, jimmyon122, jonathandeknudt, LEARN2MAKE, n00b, nyoe, pungs, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,668
Threads: 94,121
Posts: 402,901
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jonathandeknudt
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:57 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0