Description
During the process of reading data from disk to building hash tables in memory, if an exception is thrown, it will result in a memory SpilledRecordBatch leak
exception log as following
Caused by: org.apache.drill.exec.exception.OutOfMemoryException: Unable to allocate buffer of size 8192 due to memory limit (41943040). Current allocation: 3684352 at org.apache.drill.exec.memory.BaseAllocator.buffer(BaseAllocator.java:241) at org.apache.drill.exec.memory.BaseAllocator.buffer(BaseAllocator.java:216) at org.apache.drill.exec.vector.VarCharVector.allocateNew(VarCharVector.java:411) at org.apache.drill.exec.vector.NullableVarCharVector.allocateNew(NullableVarCharVector.java:270) at org.apache.drill.exec.physical.impl.common.HashPartition.allocateNewVectorContainer(HashPartition.java:215) at org.apache.drill.exec.physical.impl.common.HashPartition.allocateNewCurrentBatchAndHV(HashPartition.java:238) at org.apache.drill.exec.physical.impl.common.HashPartition.<init>(HashPartition.java:165)