SQLite Forum

Database Growing by itself to huge sizes
Login
There are only a few possible causes of the growth you report, when categorized thusly:

1. Your program is doing it.

2. Some other program is doing it.

If it is your program, you will do well to run it under a debugger and put breakpoints on the sqlite3\_prepare\_v2(), sqlite3\_step(), and sqlite3\_reset() entry points to see from where and how often they are being called, which must be a mystery to you now since you believe much less such activity is occurring.

If it is some other program, you will need to investigate tools on BSD, (which Mac OS wraps with shiny UI), that report open file handles. Obviously, if it is not your program, some other program must be accessing the file DB unbeknownst to you.

You can distinguish between cases 1 and 2 by not running your program for awhile and observing whether the mysterious growth ceases. If it ceases, your program was responsible. Otherwise, some "other" [a] program is busy and must be hunted down.

[a. I say "other" because we cannot rule out that it is one or more processes executing your program for reasons you do not yet fathom. ]