Strange SQLite leaks on iPhone
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 a开发者_JAVA技巧n idea?
Thank you :)
Leaks http://img196.imageshack.us/img196/3997/leaks.png
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:
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.
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.
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
精彩评论