Hello,

sorry for the late answer. My weekend was full of events.

> On 13 Mar 2015, at 23:32, Gregory Moore <thewatchfulone at gmail.com> wrote:
> 
> Are you interacting directly with sqlite?  Or are you using a 3rd party API 
> such as FMDB?  I take it you are not using Core Data (which optionally can 
> use a sqlite database as a datastore.)

I am using FMDB. BTW, this was visible in the call stack I sent in my first 
mail.

> Are you using ARC?  

No. The first versions of my programs are more than 3 years old. At this time I 
made bad experiences with ARC, so I do not like ARC. 

> Have you implemented the -(void)dealloc method for all your Objective-C (or 
> Swift?) objects?

Yes.

> Are you willing to share some of your application code where it interacts 
> with the sqlite database?

No problem with that. Here is a minimum example, which leaks memory.

int numberOfRestos;

FMResultSet *rs = [db executeQuery:@"SELECT count() FROM restaurant"];
while ([rs next]) {
  numberOfRestos = [rs intForColumnIndex:0];
}
[rs close];

I have chosen this example, because it does not involve any complex parameter 
passing or result handling.
This code was working perfectly without memory leaks for years. Now this 
example is leaking two memory segments of ~4.5 KB each.

Interesting fact: I am getting the same memory leaks when I am compiling Sqlite 
from source or if I am using the precompiled library, which comes with the 
Xcode development environment.

Best regards

Matthias Schmitt

magic moving pixel s.a.
23, Avenue Grande-Duchesse Charlotte
L-3441 Dudelange
Luxembourg
Phone: +352 54 75 75
http://www.mmp.lu




Reply via email to