Running instruments on the device, I intermittently incur a memory leak of exactly 3.5 KB in CFNetwork, the responsible frame being \"HostLookup_Master::HostLookup....\"
That 3.5kb memory leak sounds familiar, had that when dealing with threads:
@implementation MyClass
+ (void)login
{
//MyClass *this = [[MyClass alloc] init]; // MEMORY LEAK
MyClass *this = [[[MyClass alloc] init] autorelease];
[NSThread detachNewThreadSelector:@selector(anotherThread)
toTarget:this
withObject:nil];
}
- (void)anotherThread {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[self doStuff];
//[self release]; // MEMORY LEAK
[pool release];
}
@end
Every login created 3.5kb leak. Using autorelease solved the problem.
It seems that apple might be aware of the 3.5k leak related to CFNetwork usage and may have been reported as a bug already.