On 1/15/17, Kim Gräsman <kim.gras...@gmail.com> wrote: > > 1) If I configure a global SQLite heap with SQLITE_CONFIG_HEAP, won't > I just trade malloc heap fragmentation for SQLite private heap > fragmentation? Or does SQLite's fragmentation-prevention strategy work > well even in the face of multiple page sizes and connections?
As described in the document that you read (https://www.sqlite.org/malloc.html), if you keep your memory usage below the Robson limit, then fragmentation will never be a problem. Guaranteed. If you exceed the Robson limit, it is theoretically possible that fragmentation could cause problems. But in practice, we don't normally have issues. > > 2) What happens if the configured heap is depleted? You get SQLITE_NOMEM errors. Use sqlite3_memory_used() to monitor your memory utilization and raise alarms if it gets too high. And/or call sqlite3_db_release_memory() to try to free up memory from caches if you start to run low. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users