aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreta <tor@eta.st>2023-10-12 21:50:16 +0100
committereta <tor@eta.st>2023-10-12 21:50:16 +0100
commitea7baf006b6aa44171acfd80598f027d9e1f7d3a (patch)
tree2024aea19086b42eadc6ca16c22161c18f632ff3
parent3d8cb7b2d50daf3a6a8fc938675ff9b2bb947a5b (diff)
downloadarti-ios-sqlite-hacks.tar.gz
arti-ios-sqlite-hacks.zip
hack in some sqlite memory limits to see if that helpsios-sqlite-hacks
-rw-r--r--crates/tor-dirmgr/src/storage/sqlite.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/tor-dirmgr/src/storage/sqlite.rs b/crates/tor-dirmgr/src/storage/sqlite.rs
index 343be00a7..da8768c3e 100644
--- a/crates/tor-dirmgr/src/storage/sqlite.rs
+++ b/crates/tor-dirmgr/src/storage/sqlite.rs
@@ -106,6 +106,8 @@ impl SqliteStore {
OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE
};
let conn = rusqlite::Connection::open_with_flags(&sqlpath, flags)?;
+ conn.execute_batch("PRAGMA mmap_size=268435456;")?;
+ conn.execute_batch("PRAGMA hard_heap_limit=5000000;")?; // 5 MB
let mut store = SqliteStore::from_conn(conn, blob_dir)?;
store.sql_path = Some(sqlpath);
store.lockfile = Some(lockfile);