-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix OOM via memory limit on DB row results
We now use a 2MB page size, the same as CursorWindow.sCursorWindowSize We occasionally got OOMs on methods which returned unbounded data eg. getting the field data for notes: "Check Database" crashed To fix this, instead of saying to the Rust "we want 1000 rows max", we say "we want max 2MB of data" The calculation for the data is inexact - string length, and 8 bytes for doubles/longs. Hasn't been tested thoroughly, but seems to only be < ~7% off the protobuf size for a string-only column (underestimate). We measure the rust in-memory usage rather than the size of the serialized protobuf Measuring the serialized size wasn't researched, but was assumed to be hard, as we would need to stream into a protobuf collection, and be able to efficiently query the new size for each row we add. Main changes: StreamingProtobufSQLiteCursor - no longer use pages dbcommand: allow access via an offset to the result set rather than via pages Adds: setDbPageSize to allow the change of the size for debugging Adds: Unit tests for the rust - not yet executed in CI (#51) rename: getPage -> getNextSlice bumps `anki` commit to add field sqlite.proto#DbResponse:start_index Fixes #14 (no longer necessary) Fixes ankidroid/#8178
- Loading branch information
1 parent
567ab9d
commit 03a9d6b
Showing
12 changed files
with
384 additions
and
69 deletions.
There are no files selected for viewing
Submodule anki
updated
from c597f2 to c9e120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.