Skip to content

Reduce memory usage when merging bkd trees #14382

Closed
@iverase

Description

@iverase

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions