views:

125

answers:

2

Hi,

I'm looking to clean all my app's leaks.

As you can see on the picture below, SQLite makes a lot of memory leak. I do use SQLite through CoreData. The strangest thing is that AdresseBook is making all the libsqlite3 leak and I never use the AdressBook!!!

Do you have an idea?

Thank you :)

Leaks

A: 

Can we see the entire trace?

Also I'm guessing you've already run the static analyser? If not you can find it by going to: Build -> Build and Analyse

James Raybould
A: 

CoreData doesn't produce any known leaks, therefore your app must be triggering this somehow. AddressBook is a relatively ubiquitous framework on the iPhone in that other system frameworks will end up pulling in AB and AB's data.

Thus, there is something in your app that is triggering the use of AB which is then triggering the use of CoreData.

In any case, since you don't use SQLite directly, you should focus your analysis efforts higher in the stacktrace; at the interface between your code and the system frameworks. Looking at that screenshot, there are two suspicious attributes:

  1. Frames 46, 47, and 48 don't have symbols. Are you running a debug build? If not, do so and those frames should be resolved.

  2. There is a bunch of thread related stuff mentioned. Are you absolutely certain you have done your threading correctly? It is quite easy to create leaks in a threaded application.

(There is also the possibility that these "leaks" aren't really leaks, but are false positives. Probably not, but there is a slight chance you are chasing ghosts)

In any case, the best approach to fixing leaks is to focus on the easy leaks first -- the ones you understand -- and see what remains. Many leaks are often the by-product of other leaks.

bbum