Skip to content

WIP Reduce fetch phase heap consumption #127386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

original-brownbear
Copy link
Contributor

WIP because even though this passes tests in its current form, it's a little flimsy :) I'll open a dependency for hardening the RecyclerBytesStream to ReleasableBytesReference transition to be merged before this one. For now I'd just like to get a CI run out of it :)

This cuts the peak heap consumption for handling large fetch results by up to 50% by avoiding having all results as well as their serialized for on heap at the same time. A follow up can take this to its logical conclusion and pass the network buffer straight down into the actual fetch execution, avoiding the need to even allocate SearchHits in the first place or if taken yet another step further, it could even go as far as avoiding the need to allocate the individual hits in full.

This cuts the peak heap consumption for handling large fetch results by up to 50%
by avoiding having all results as well as their serialized for on heap at the same time.
A follow up can take this to its logical conclusion and pass the network buffer straight
down into the actual fetch execution, avoiding the need to even allocate `SearchHits` in the
first place or if taken yet another step further, it could even go as far as avoiding
the need to allocate the individual hits in full.
@original-brownbear original-brownbear added WIP :Search Foundations/Search Catch all for Search Foundations labels Apr 25, 2025
@original-brownbear original-brownbear marked this pull request as draft April 25, 2025 10:00
@original-brownbear
Copy link
Contributor Author

#127404 makes it possible to do this a little shorter and nicer looking, lets see if that is an option first before un-drafting this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search Foundations/Search Catch all for Search Foundations v9.1.0 WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants