Description
In org.apache.hadoop.mapred.MapTask.MapOutputBuffer.flush() method, we only released the kvbuffer before the merge phase (i.e., mergeParts()). Though kvindices and kvoffsets are small in many cases, we should release them theoretically before mergeParts().
try
{ spillThread.interrupt(); spillThread.join(); }catch (InterruptedException e)
{ throw (IOException)new IOException("Spill failed" ).initCause(e); } // release sort buffer before the merge
kvbuffer = null;
mergeParts();
Path outputPath = mapOutputFile.getOutputFile();
fileOutputByteCounter.increment(rfs.getFileStatus(outputPath).getLen());
}