Skip to content

Fix over-allocation of result bitset in MemoryAccountingBitsetCollectorManager - #16452

Open
Sasilekha wants to merge 1 commit into
apache:mainfrom
Sasilekha:tighten-memory-accounting-bitset-result-size
Open

Fix over-allocation of result bitset in MemoryAccountingBitsetCollectorManager#16452
Sasilekha wants to merge 1 commit into
apache:mainfrom
Sasilekha:tighten-memory-accounting-bitset-result-size

Conversation

@Sasilekha

Copy link
Copy Markdown
Contributor

Size the reduce() result FixedBitSet to the highest matched doc + 1 instead of the largest maxDocEnd across collectors. The old sizing was inflated to the last visited leaf's docBase+maxDoc even when the query matched only a small subset, and under intra-segment concurrency it could equal the full index maxDoc.

@Sasilekha
Sasilekha force-pushed the tighten-memory-accounting-bitset-result-size branch from d6ab44f to 755683b Compare August 1, 2026 12:33
@Sasilekha
Sasilekha marked this pull request as ready for review August 2, 2026 07:29
…orManager

Size the reduce() result FixedBitSet to the highest matched doc + 1
instead of the largest maxDocEnd across collectors. The old sizing was
inflated to the last visited leaf's docBase+maxDoc even when the query
matched only a small subset, and under intra-segment concurrency it
could equal the full index maxDoc.
@Sasilekha
Sasilekha force-pushed the tighten-memory-accounting-bitset-result-size branch from 755683b to 837c512 Compare August 4, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant