Repository navigation
Bound the memory of bleve indexing - #3900
Merged
Merged
Conversation
Push a batch at 16 MiB of document data or before a document would overflow it. Reindexing large text files ran out of memory otherwise.
bleve keeps the analysis of a whole batch in memory until it is written, so batches of spaces reindexed in parallel stacked up their memory.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 18 |
🟢 Coverage 89.47% diff coverage · +0.02% coverage variation
Metric Results Coverage variation ✅ +0.02% coverage variation (-1.00%) Diff coverage ✅ 89.47% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (12d8edb) 93317 26496 28.39% Head commit (5bda7dd) 93330 (+13) 26514 (+18) 28.41% (+0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3900) 19 17 89.47% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
butonic
approved these changes
Nov 5, 2026
aduffeck
force-pushed
the
search-index-memory
branch
from
November 9, 2026 07:22
0ec42c8 to
5bda7dd
Compare
aduffeck
enabled auto-merge
November 9, 2026 07:22
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reindexing with bleve could run the search service out of memory. At 3 GB, a forced reindex of about 34,000 book-length text files was OOM-killed after five minutes. Two causes:
Contentthat takes more than ten times the size of the text.--concurrency Nwrites N batches at once, each keeping its analysis in memory until it is written.Changes
Measurements
8.1.0 with these commits, full
--force-rescanof 11 spaces at--concurrency 3, 22 GB index.At 12 GB, indexing took about 5% longer than plain 8.1.0 built the same way, which is within the variation between runs (up to 12%). Without the one-batch-at-a-time change, analysis peaked at 0.84 GB, both 3 GB runs were killed, and 12 GB got no faster.
fixes #3797
Assisted by Claude Opus 5.5