"Rich Rattanni" <[EMAIL PROTECTED]> wrote: > On 4/3/07, Rich Rattanni <[EMAIL PROTECTED]> wrote: > > All: > > I was wondering exactly how SQLite handles freeing memory used > > from the heap when compiled without SQLITE_ENABLE_MEMORY_MANAGEMENT? > > > > Will absolutely no memory be freed, or is there some default > > memory management scheme used? > > > > Let me explain my question better... > SQLITE on my system has been compiled without the > SQLITE_ENABLE_MEMORY_MANAGEMENT define. I have a thread that writes a > hundred or so samples into a database every 30 seconds. I do not open > and close the database pointer each time, but I do prepare and > finalize a statement for each transaction. I have notices that the > memory used by my program slowly but surely increases as the program > runs (about 24 hrs sees a 40%+ increase in system memory). I have > checked, and rechecked the program for any memory leaks on my part, > but I have no found any obvious ones. I just wanted to know if > sqlite, as compiled for my system, will use as much memory as it sees > fit in a particular thread if compiled without > SQLITE_ENABLE_MEMORY_MANAGEMENT? > > Can anyone answer this for me? >
SQLite does not leak memory, if that what you are asking. You do not need to compile with SQLITE_ENABLE_MEMORY_MANAGEMENT in order to prevent memory leaks. The SQLITE_ENABLE_MEMORY_MANAGEMENT macro is used to enable two APIs used for tighter control of memory on resource limited embedded devices: sqlite3_release_memory() sqlite3_soft_heap_limit() I recommend you run your program in valgrind to find out where the memory is leaking. -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------