Skip to content

Commit

Permalink
[FLINK-10339][network] Use off-heap memory for SpillReadBufferPool
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijiangW authored and NicoK committed Oct 1, 2018
1 parent 6ba2a0b commit 2ab55df
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import javax.annotation.concurrent.GuardedBy;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -257,7 +258,8 @@ private static class SpillReadBufferPool implements BufferRecycler {

synchronized (buffers) {
for (int i = 0; i < numberOfBuffers; i++) {
buffers.add(new NetworkBuffer(MemorySegmentFactory.allocateUnpooledSegment(memorySegmentSize), this));
ByteBuffer memory = ByteBuffer.allocateDirect(memorySegmentSize);
buffers.add(new NetworkBuffer(MemorySegmentFactory.wrapPooledOffHeapMemory(memory, null), this));
}
}
}
Expand Down

0 comments on commit 2ab55df

Please sign in to comment.