This discussion is archived
1286 Views 6 Replies Latest reply: Jul 25, 2008 4:25 PM by tazz_ben
Currently Being ModeratedJul 22, 2008 4:53 PM (in response to whafrog)Hey Jon -
First for the class you need to have:
Also make sure in the frameworks folder to add:
Other thing --- Conserve your connections to SQLite. I don't know why, but it seems that when you finalize and close a connection, all of the resources for sqlite3_step aren't released (even though it isn't reported as a leak, you can see your object allocation go up). So while it may seem like a plan to close the DB on a memory warning, it's better to keep it open for the life of the app.iMac (intel), Mac OS X (10.4.6)
Currently Being ModeratedJul 24, 2008 6:05 PM (in response to tazz_ben)I'm having this same problem you mention with sqlite3_finalize not freeing up all the resources used by a query. It's driving me nuts because it seems to be consistently filling up my memory in exactly the way you describe, and of course that eventually causes my iPhone application to crash .
Do you have any details on how to fix this, or how to deal with it better? It's really messing up my memory allocation big-time .
DMacBook Pro 2.4ghz; iPhone with version 2.0 software, Mac OS X (10.5.4)
Currently Being ModeratedJul 24, 2008 6:17 PM (in response to David Dennis)Are you following the example set by the SQLiteBooks sample? You should only prepare and finalize frequently used queries once per app lifetime, and just reset them after each use.
Currently Being ModeratedJul 25, 2008 4:25 PM (in response to David Dennis)Yeah, David, like the other responder I reduced my connections to 3. Though I disagree with him that this is the way it's suppose to be. I really wish this was fixed. In a mobile app, it makes a lot of sense to be opening and closing the database depending on the memory condition.iMac (intel), Mac OS X (10.5.4)