views:

95

answers:

1

I have CFArray and CFString allocations going all red while checking on the Instruments Object Alloc.

Object seem to be alive but not being used, this because the used part of the histogram is 1/10th of the total histogram (which has turned red) in both cases.

the app is a photo library application with 7 view controllers. Loading up thumbnail images for each individual view controller, and then loading the image on need basis. Just going back and forth between two view controllers keeps pushing the CFArray histogram up.

let me know if posting the code here would help.

Thanks, P

+1  A: 

Posting code will always help. As it is, your question is very general and, thus, the answer will be very general, too.

From the sound of it, it doesn't seem like you necessarily have a leak as much as a situation where you are surprised by the number of short lived objects being created.

If it is impacting the performance of your app -- if your app is sluggish or unresponsive -- then it is worthy of further investigation. If it isn't a perf problem, then I wouldn't worry about it too much (but would consider what happens as the data set grows).

If you want to analyze this further, figure out where the objects are coming from. Instruments will provide the backtraces of the points of allocation. Choose a random set of the objects that have come and gone and click through to see the stack traces and/or allocation related events of that object.

If you see the same stack repeated often, that gives you a really good starting point for figuring out how to reduce the memory chatter in your app.

That stack trace will also be a really good bit of content to form a new question or extend this question.

bbum