viirya commented on a change in pull request #26828: [SPARK-30198][Core] 
BytesToBytesMap does not grow internal long array as expected
URL: https://github.com/apache/spark/pull/26828#discussion_r356750942
 
 

 ##########
 File path: core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java
 ##########
 @@ -741,7 +741,9 @@ public boolean append(Object kbase, long koff, int klen, 
Object vbase, long voff
         longArray.set(pos * 2 + 1, keyHashcode);
         isDefined = true;
 
-        if (numKeys >= growthThreshold && longArray.size() < MAX_CAPACITY) {
 
 Review comment:
   `lookup` just looks up for empty slot in the internal array for a new key. 
It does not allocate memory. The array is allocated/grown up in last time 
`append`.
   
   Once an empty slot (a `Location` object) is found, the client of 
`BytesToBytesMap` may call `append` to the Location, OOM could be thrown during 
append new key/value.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to