Skip to content

Introduce MemoryAccountingBitsetCollectorManager#15795

Open
gaobinlong wants to merge 4 commits intoapache:mainfrom
gaobinlong:MemoryAccountingBitsetCollectorManager
Open

Introduce MemoryAccountingBitsetCollectorManager#15795
gaobinlong wants to merge 4 commits intoapache:mainfrom
gaobinlong:MemoryAccountingBitsetCollectorManager

Conversation

@gaobinlong
Copy link
Copy Markdown
Contributor

Description

This pr introduces MemoryAccountingBitsetCollectorManager and switches TestMemoryAccountingBitsetCollector.java to use search concurrency and move away from the deprecated search(Query, Collector) method.

Relates to #12892.

Signed-off-by: Binlong Gao <gbinlong@amazon.com>
@github-actions github-actions bot added this to the 11.0.0 milestone Mar 4, 2026
Signed-off-by: Binlong Gao <gbinlong@amazon.com>
protected void doSetNextReader(LeafReaderContext context) throws IOException {
docBase = context.docBase;
length += context.reader().maxDoc();
length = docBase + context.reader().maxDoc();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change works for both single-thread case and concurrency search case, the original code doesn't work for concurrency search case since length always starts from 0 for each collector.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we're creating a maxDoc-length FixedBitSet for every thread? I wonder if there's a way of being more memory efficient here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've refactored the code to make it memory efficient for concurrent search case, please take a look, thanks!

@gaobinlong
Copy link
Copy Markdown
Contributor Author

Hi @romseygeek , would you mind taking look into this PR? Thank you~

@github-actions
Copy link
Copy Markdown
Contributor

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Mar 26, 2026
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.

2 participants