kfaraz commented on code in PR #13219:
URL: https://github.com/apache/druid/pull/13219#discussion_r994041387
##########
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/data/input/MapPopulator.java:
##########
@@ -245,7 +245,8 @@ static long getByteLengthOfObject(@Nullable Object o)
{
if (null != o) {
if (o.getClass().getName().equals(STRING_CLASS_NAME)) {
- return ((String) (o)).length();
+ // Each String object has ~40 bytes of overhead
+ return ((long) ((String) (o)).length() * Character.BYTES) + 40;
Review Comment:
You could also consider doing this instead:
https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/StringDimensionDictionary.java#L41-L47
--
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]