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

   `RamUsageEstimator.sizeOfObject` returns the shallow size for `Integer` and 
`Long`, but `Boolean`, `Byte`, `Character`, `Short`, `Float` and `Double` fall 
through to `UNKNOWN_DEFAULT_RAM_BYTES_USED` (256 bytes). These classes hold a 
single primitive field, so their shallow size is their whole retained size (16 
or 24 bytes). A collection of boxed doubles is over-counted by about 10x as a 
result.
   
   This came up in Elasticsearch, where numeric field values returned by a 
search are estimated through `sizeOfObject` for request circuit breaker 
accounting.
   
   This change follows #11715, which did the same for `Integer`. It adds size 
constants for the six missing types and uses them in `sizeOfObject`, without 
new public `sizeOf` overloads. Like `sizeOf(Integer)`, the estimates ignore 
JVM-cached instances, so they can over-count but never under-count.


-- 
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