SQLite Forum

after crash loosing all records in a multi-GB table
Login
I second Mr. Damon's idea that it *may* be easier to debug the application crash.

There is another, perhaps better reason to focus on that early. The crash may well be producing ill effects other than sudden termination of the process, effects which occur sooner than that bitter end. These effects can include corruption of the heap, including the one used by SQLite. They can include corruption of in-process data structures used for file I/O. They can include corruption of application data which drive the data collection and subsequent storage. Any of these ill effects could be involved in producing the symptoms you see (and apparently hope might be attributed to SQLite. [a])

[a. That attribution is highly unlikely and a waste of brain cycles at this point. ]

Your report of unbounded allocated memory growth also indicates that some code cleanup is due. Once that cleanup is done and the application address faults are vanquished, you may well find that SQLite behaves per your expectation. (You can use a process kill to simulate the crash to ascertain the 'D' part of SQLite's ACID guarantees.) If it behaves well then, and you have spent time fixing actual bugs in your code, you will be glad to have not wasted time wondering why SQLite behaved strangely in an undefined [b] execution environment.

[b. The phrase "undefined behavior" is used to describe the effect of many deviations from correct usage of the C or C++ languages. That behavior includes the kind of mysterious misbehavior you are hoping to find a remedy for here. ]