Skip to content

PointInSetQuery#ramBytesUsed under-reports memory: retained lowerPoint / upperPoint arrays not accounted for #16405

Description

@Sasilekha

Description

PointInSetQuery#ramBytesUsed() under-reports memory because the retained lowerPoint and upperPoint byte arrays are omitted from the sum.

ramBytesUsed =
BASE_RAM_BYTES
+ RamUsageEstimator.sizeOfObject(field)
+ RamUsageEstimator.sizeOfObject(sortedPackedPoints);

LRUQueryCache and any other Accountable consumer sum ramBytesUsed() when deciding what to cache and enforcing memory budgets. Cached PointInSetQuery (including its factory-produced variants —LongPoint, FloatPoint, BinaryPoint) is currently under-counted, so the cache can hold slightly more than its declared memory limit.

Version and environment details

Reproduces on apache/main , using OpenJDK 25.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions