3 ms·
A bit off topic, but there seems to be quite a few SQLite experts here. We're having troubles with memory usage when using SQLite in-memory DBs with "a lot" of
by Leherenn 11mo ago
A bit off topic, but there seems to be quite a few SQLite experts here.
We're having troubles with memory usage when using SQLite in-memory DBs with "a lot" of inserts and deletes. Like maybe inserting up to a 100k rows in 5 minutes, deleting them all after 5 minutes, and doing this for days on end. We see memory usage slowly creeping up over hours/days when doing that.
Any settings that would help with that? It's particularly bad on macOS, we've had instances where we reached 1GB of memory usage according to Activity Monitor after a week or so.
- asa400 11mo agoAre you running vacuums at all? auto_vacuum enabled at all? https://sqlite.org/lang_vacuum.html https://sqlite.org/lang_vacuum.html
- porridgeraisin 11mo agoIn memory DBs don't have anything to vacuum. However... what you (and OP) are looking for might be pragma shrink_memory [1]. [1] https://sqlite.org/pragma.html#pragma_shrink_memory https://sqlite.org/pragma.html#pragma_shrink_memory
- asa400 11mo agoAh, you're correct. I read too fast and missed that it was in-memory databases specifically!
- kachapopopow 11mo agosounds like normal behavior of adjusting buffers to better fit the usecase, not sure if it applies to sqlite or if sqlite even implements dynamic buffers.
- pstuart 11mo agoIf you're deleting all rows you can also just drop the table and recreate it.
- deleted 11mo ago[deleted]