views:

255

answers:

1

This is a bit of a general question, I am debugging and testing on the iPhone and the leaks performance tool is reporting a ton of relatively small leaks from code that I didn't write. I.e. in the responsible frame column the following are blamed for leaks:

[UIColor allocWithZone:]
NSKeyedUnarchiver
NSCFString copyWithZone
CGTypeCreateInstanceWithAllocator
UIView _createLayerWithFrame:
mem_alloc

The responsible libraries are mainly Foundation, with a couple from UIKit and CoreGraphics, and the mem_alloc leak is blamed on QuartzCore.

They add up to about 40KB after 10 minutes of touching buttons at random to try to cause leaks.

I can narrow them down more, but it will take time. Is it usual to get these leaks, or should I comb through and find the root causes of them?

Thanks for any help.

A: 

These are possibly your leaks. Here would be one way of triggering the UIColor leak:

for (int i = 0; i < 1000; i++)
    [[UIColor allocWithZone:NULL] initWithWhite:1.0f alpha:1.0f];
rpetrich