grimoire_app's memory stops climbing: one embedding call at a time, and a streamed backup #244

Merged
bvandeusen merged 2 commits from dev into main 2026-12-06 11:19:54 -05:00
2 Commits
Author SHA1 Message Date
bvandeusenandClaude Opus 5.5 f19ba0c798 fix(8822): the backup converts each table as it reads it and streams each section to disk
CI & Build / TypeScript typecheck (push) Successful in 10s
CI & Build / Plugin hooks (push) Successful in 16s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 1m54s
CI & Build / integration (push) Successful in 1m57s
CI & Build / Build & push image (push) Successful in 28s
The export held every table's ORM objects and every table's rows at once,
and the archive writer then built each section as one byte string (a peak of
twice the section). The nightly run raised the app's memory about 200 MB that
it kept. Each table is now converted before the next is read, and each section
is encoded into a spool file that moves to disk past 1 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-06 10:50:23 -05:00
bvandeusenandClaude Opus 5.5 6052a66aca fix(8822): the embedding model runs one call at a time, on at most 8 threads
onnxruntime keeps a memory arena per run in flight and never returns it, so
overlapping requests grew the app a step at a time and it never came down:
measured in the live container, 32 concurrent callers reached 17.3 GB where
the same work one call at a time stayed flat at 1.07 GB. Every model call now
runs on a single worker thread, and the model loads with a thread pool capped
at 8 instead of one thread per host core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-06 10:50:23 -05:00