Github user kiszk commented on a diff in the pull request: https://github.com/apache/spark/pull/21481#discussion_r194561368 --- Diff: core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java --- @@ -703,7 +703,7 @@ public boolean append(Object kbase, long koff, int klen, Object vbase, long voff // must be stored in the same memory page. // (8 byte key length) (key) (value) (8 byte pointer to next value) int uaoSize = UnsafeAlignedOffset.getUaoSize(); - final long recordLength = (2 * uaoSize) + klen + vlen + 8; + final long recordLength = (2L * uaoSize) + (long)klen + (long)vlen + 8L; --- End diff -- You are right. It was too conservative. ` (2L * uaoSize) + klen + vlen + 8` can generate `LMUL` or `LADD` as follows: ``` LDC 2 ILOAD 9 I2L LMUL ILOAD 4 I2L LADD ILOAD 8 I2L LADD LDC 8 LADD LSTORE 10 ```
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org