shrink memory every X messages #9

Manually merged
andreacavalli merged 1 commits from :memory_cleanup into fork 2020-01-08 18:58:55 +01:00
Showing only changes of commit 3d4fdae800 - Show all commits

View File

@ -293,6 +293,7 @@ class MessagesDbImpl : public MessagesDbSyncInterface {
if (seqno_ % 8128 == 0) {
TRY_STATUS(db_memory_.exec("DELETE FROM messages WHERE seqno < " + to_string(seqno_ - 7168)));
TRY_STATUS(db_.exec("PRAGMA shrink_memory"));
}
add_message_stmt_.bind_int32(12, seqno_).ensure();