MemoryConsumer is the contract for memory consumers of
TaskMemoryManager with support for spilling.
MemoryConsumer basically tracks how much memory is allocated.
MemoryConsumer requires a TaskMemoryManager with optional
pageSize and a
If not specified,
abstract long spill(long size, MemoryConsumer trigger) throws IOException
used is the amount of memory in use (i.e. allocated) by the
protected void freePage(MemoryBlock page)
freePage is a protected method to deallocate the
LongArray allocateArray(long size)
However, if it was not possible to allocate the
size memory, it shows the current memory usage and a
OutOfMemoryError is thrown.
Unable to acquire [required] bytes of memory, got [got]
long acquireMemory(long size)
void throwOom(final MemoryBlock page, final long required)