Skip to content

Commit

Permalink
[EXT][SPARK-18208] [Shuffle] Executor OOM due to a growing LongArray …
Browse files Browse the repository at this point in the history
…in BytesToBytesMap apache#15722
  • Loading branch information
zzcclp committed Dec 8, 2016
1 parent 8e57d83 commit 4ee0adc
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public final class BytesToBytesMap extends MemoryConsumer {

private long peakMemoryUsedBytes = 0L;

private final int initialCapacity;

private final BlockManager blockManager;
private volatile MapIterator destructiveIterator = null;
private LinkedList<UnsafeSorterSpillWriter> spillWriters = new LinkedList<>();
Expand Down Expand Up @@ -194,6 +196,7 @@ public BytesToBytesMap(
throw new IllegalArgumentException("Page size " + pageSizeBytes + " cannot exceed " +
TaskMemoryManager.MAXIMUM_PAGE_SIZE_BYTES);
}
this.initialCapacity = initialCapacity;
allocate(initialCapacity);
}

Expand Down Expand Up @@ -848,12 +851,12 @@ public LongArray getArray() {
*/
public void reset() {
numElements = 0;
longArray.zeroOut();

freeArray(longArray);
while (dataPages.size() > 0) {
MemoryBlock dataPage = dataPages.removeLast();
freePage(dataPage);
}
allocate(initialCapacity);
currentPage = null;
pageCursor = 0;
}
Expand Down

0 comments on commit 4ee0adc

Please sign in to comment.