Skip to content

Reduce memory usage when merging bkd trees #14382

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

Closed
iverase opened this issue Mar 21, 2025 · 1 comment
Closed

Reduce memory usage when merging bkd trees #14382

iverase opened this issue Mar 21, 2025 · 1 comment

Comments

@iverase
Copy link
Contributor

iverase commented Mar 21, 2025

When building BKD trees, we hold two arrays in memory which sizes grows linearly with the number of leaf nodes. One of the array contains the pointer to the start of a leaf node, and the other containing the split value. The number of leaf nodes does not grow with the number of documents but with the number of values, therefore in the case of multi-values, those arrays can grow quite big.

The situation is particularly inefficient for the OneDimensionBKDWriter where we are using a List to hold the split values. I wonder if we can use more efficient data structures to lower the heapusage.

For example, maybe we can use the FixedLengthBytesRefArray to hold split values or used some packing algorithm to hold the leaf pointers.

@iverase
Copy link
Contributor Author

iverase commented Mar 25, 2025

We are using more dense data structures now, in particular for the OneDimensionBKDWriter.

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

No branches or pull requests

1 participant