Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,10 @@ public boolean append(Object kbase, long koff, int klen, Object vbase, long voff
assert (vlen % 8 == 0);
assert (longArray != null);

if (numKeys == MAX_CAPACITY
// We should not increase number of keys to be MAX_CAPACITY. The usage pattern of this map is
// lookup + append. If we append key until the number of keys to be MAX_CAPACITY, next time
// the call of lookup will hang forever because it cannot find an empty slot.
if (numKeys == MAX_CAPACITY - 1
// The map could be reused from last spill (because of no enough memory to grow),
// then we don't try to grow again if hit the `growthThreshold`.
|| !canGrowArray && numKeys >= growthThreshold) {
Expand Down