We are using Sqlite3 being an embedded database on the C++ based project. The procedure that utilizes the sqlite3 interface (the one which really commits log records) seems to grow its heap memory because the database increases in dimensions.

The heap memory expansion certainly is proportional to how big database (evidence: when the "place-to-database" lines are said the expansion never happens And when log wrapping is enabled, once the database begins to wrap the development stops occurring as though it's at their maximum).

We are on the unix-like OS.

Does anybody determine if SQLITE3 works some type of caching we're able to disable, if UNIX might be carrying this out itself, or if it's an issue whatsoever always? Worries here's clearly that heap memory might be exhausted, leading to our bodies to crash.

I've come across the odd mention of the UNIX caching things itself and delivering the cache-related memory when it is needed otherwise, but I'm not sure enough regarding the subject to become confident about this being true. I've not effectively found anything relevant (which i understand) in SQLITE3 documentation.

I determined following a couple of days which you can use a pragma upon database creation or just before connection opening to mitigate this problem. I'll publish it as being an recognized answer since no-one even said about this question since its posting.

Set this with the sqlite3 interface and hang it to or perhaps a number you want more.

PRAGMA cache_size=0; 

to prevent the procedure memory from growing based on the database size. Apparently, despite the fact that you will find "default" caching limits, they either were disabled or simply no longer working within our implementation - possibly because of compilation options used while mix-producing sqlite3. Setting the pragma causes it to be correctly enforce the limits to prevent the procedure size growth.

Here is a reference for more information:

http://www.sqlite.org/pragma.html#pragma_cache_size