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
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.

@github-actions github-actions bot added this to the 11.0.0 milestone Mar 4, 2026
Signed-off-by: Binlong Gao <[email protected]>
protected void doSetNextReader(LeafReaderContext context) throws IOException {
docBase = context.docBase;
length += context.reader().maxDoc();
length = docBase + context.reader().maxDoc();
Copy link
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
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
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
Contributor Author

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

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