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
Description
PointInSetQuery#ramBytesUsed()under-reports memory because the retainedlowerPointandupperPointbyte arrays are omitted from the sum.ramBytesUsed =
BASE_RAM_BYTES
+ RamUsageEstimator.sizeOfObject(field)
+ RamUsageEstimator.sizeOfObject(sortedPackedPoints);
LRUQueryCacheand any otherAccountableconsumer sumramBytesUsed()when deciding what to cache and enforcing memory budgets. CachedPointInSetQuery(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