Skip to content

Fix PointInSetQuery#ramBytesUsed to include retained bounds arrays#16406

Open
Sasilekha wants to merge 2 commits into
apache:mainfrom
Sasilekha:pointinsetquery-rambytes-undercount
Open

Fix PointInSetQuery#ramBytesUsed to include retained bounds arrays#16406
Sasilekha wants to merge 2 commits into
apache:mainfrom
Sasilekha:pointinsetquery-rambytes-undercount

Conversation

@Sasilekha

Copy link
Copy Markdown
Contributor

Addresses #16405

PointInSetQuery retains two byte[] fields (lowerPoint, upperPoint) allocated in its constructor but its cached ramBytesUsed sums only field & sortedPackedPoints where both arrays are missing
ramBytesUsed = BASE_RAM_BYTES + RamUsageEstimator.sizeOfObject(field) + RamUsageEstimator.sizeOfObject(sortedPackedPoints)

Every non-empty query built via LongPoint.newSetQuery, IntPoint.newSetQuery, FloatPoint.newSetQuery etc therefore underreports its footprint to LRUQueryCache causing cached entries to stay resident longer than maxRamBytesUsed intends to

@Sasilekha
Sasilekha marked this pull request as ready for review July 20, 2026 07:22
@Sasilekha

Copy link
Copy Markdown
Contributor Author

@mikemccand can you help review this pr please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant