chrisparrinello opened a new pull request, #17000:
URL: https://github.com/apache/lucene/pull/17000

   ### Description
   
   `IntObjectHashMap`, `LongObjectHashMap` and `CharObjectHashMap` compute 
`ramBytesUsed()` via `sizeOfValues()`, which passed the iteration cursor 
(`ObjectCursor`) to `RamUsageEstimator.sizeOfObject` instead of the stored 
value. The cursor is never `Accountable`, so every entry was counted as the 
flat 256-byte `UNKNOWN_DEFAULT_RAM_BYTES_USED`, regardless of the value's own 
`ramBytesUsed()`.
   
   The fix passes `value.value`. Values that are `Accountable` now report their 
real size; non-`Accountable` values still fall back to the 256-byte default, so 
callers whose values are not `Accountable` (e.g. the HNSW/flat vectors readers' 
`FieldEntry` records) are unchanged.
   
   Adds `testRamBytesUsedCountsAccountableValues` to each of the three map test 
classes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to