fix(memory): cap SQLite pools and shrink the event cache periodically #159
No reviewers
Labels
No labels
blocked
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
waiting-on-julian
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jlxq0/matrix-mcp!159
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/memory-growth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
v0.10.17already frees replaced clients (#158), but the pod (limit 1Gi) still climbed from about 10Mi to 1Gi in steps within 1–2 days, and was OOMKilled 5 times in 6 days. One Matrix client is active, syncing about 500–900 responses an hour.Two remaining contributors, both in how matrix-sdk 0.19 is configured:
SqliteStoreConfig::newgives each store4 x physical CPUsconnections with a 2 MB page cache, and a client has four stores. Connections keep their cache once opened, which fits the step-shaped growth. This switches to the SDK'swith_low_memory_configpreset (one connection per physical CPU, 500 KB cache), with the same passphrase. A test proves the store still refuses a wrong passphrase.Subscriber::drop→auto_shrink_if_no_subscribers), and nothing here subscribes to rooms (#158 notes the same). A 15-minute task per client now takes and drops a subscriber for each joined room. It holds only aWeak<Client>and is aborted inCachedClient::dropnext to the sync task, so #158's freed-client test still holds.Plus
fix(deps): vodozemac 0.11.2 and ctutils 0.4.8 for RUSTSEC-2026-0445/0451/0385, which were published after v0.10.17 and failcargo auditon main.On toolchain 1.98.0 (CI's): fmt, clippy
-D warningsandcargo test --all-featuresall pass (389 + 6 tests), andcargo auditis clean apart from the 2 allowed warnings.Note:
v0.10.18was tagged by mistake oneccda5d, the same commit asv0.10.17. This change ships asv0.10.19.🤖 Generated with Claude Code
https://claude.ai/code/session_01E2xQRZnoBbY9SEC5nF6J4U
4156f4ea440c4fc04f95