kfaraz commented on code in PR #13219:
URL: https://github.com/apache/druid/pull/13219#discussion_r994278022


##########
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:
   I think we can proceed with what you have. It's a difference of just 4 bytes 
(40 vs 44) per String anyway, and as you mention, it does depend on java 
version.



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