* You are viewing the archive for the ‘Tech Articles’ Category

Software crash on LandingGear->Deploy()

Referencing and de-referencing objects in an Object Oriented Environment can be a challenge.These are real life examples; the names of the objects have been changed to preserve the identity of the victims. Please fasten your seat belt.

When I take an airplane, I cannot help but think of all the poor programming practices I have witnessed -some committed by myself- over the years. I often wonder if the on-board computers have been programmed by my earlier engineering peers.
Continue Reading

Finding hidden memory leak with Instruments

Using the 1 Mb NSDateFormatter memory leak as a case-study, this tutorial shows how to locate and isolate unexpected memory allocation using Instruments. Technically, this 1 Mb loss is arguably not a leak, since the data is cached, and is still actively referenced by the system. Yet…

Instruments has built-in tools to isolate true leaks (lost blocks) but can also be used to locate memory loss. While this session references iPhone OS 3.1.3, it can be generalized: only the example is specific, not the concept.

Continue Reading

NSDateFormatter memory leak

This is a follow-up to a post on stackoverflow.com, where it appears that 1 MB is lost after invoking NSFormatter -dateFromString.

I ran into the same situation, with very similar leak sizes to the ones reported on that article. Instruments shows that 868 Kb (889520 bytes to be exact) are allocated by Cocoa on iPhone OS (verified from 2.x to 3.x up to 3.1.3).
Continue Reading

Drowning in NSAutoreleasePool

When developing in Cocoa for Mac OS X or for iPhone, it is easy to overlook objects that are dropped in the current NSAutoreleasePool, ultimately leading to a crash. The following article applies to the use of NSAutoreleasePool when garbage collection is not enabled.

Continue Reading

NSLog(@”Hello world!”);

Welcome to TheGothicParty.com/dev.

Mission Statement:
Post software development insights as I come across them.
Paperblog