Skip to content

btindex: use off-heap EliasFano during build#21777

Merged
AskAlexSharov merged 2 commits into
mainfrom
alex/bt_streaming_build2_36
Jun 15, 2026
Merged

btindex: use off-heap EliasFano during build#21777
AskAlexSharov merged 2 commits into
mainfrom
alex/bt_streaming_build2_36

Conversation

@AskAlexSharov

@AskAlexSharov AskAlexSharov commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Bloatnet has "peak mem jumps during merge". On heap-profiler I saw 3Gb used by EF inside .bt building.
And for #20638

This PR:

  • using less RAM for EF building.
  • no file format change.

Next PR:

  • will also remove "greedy keys copy" during build of btindex

…ndex build

NewEliasFano allocates a multi-GB contiguous bit array on the Go heap for
large snapshots (mainnet: ~2B keys → ~3.5 GB). NewEliasFanoOffHeap backs
the same arrays with a mmap'd temp file so the OS pages it, avoiding the
heap spike.
@AskAlexSharov AskAlexSharov changed the title db/datastruct/btindex: use off-heap mmap for EliasFano during BTree index build btindex: use off-heap EliasFano during build Jun 13, 2026
@AskAlexSharov

Copy link
Copy Markdown
Collaborator Author

Re-run needed: both hive failures are infra flakes (Docker daemon EOF + operation cancelled), not related to the code change.

@AskAlexSharov AskAlexSharov added this pull request to the merge queue Jun 15, 2026
Merged via the queue into main with commit 4d06f94 Jun 15, 2026
173 of 176 checks passed
@AskAlexSharov AskAlexSharov deleted the alex/bt_streaming_build2_36 branch June 15, 2026 04:13
AskAlexSharov added a commit that referenced this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants