diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index becae367d1..10406267a2 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -394,6 +394,9 @@ Release 2.7.0 - UNRELEASED OPTIMIZATIONS + HADOOP-11323. WritableComparator#compare keeps reference to byte array. + (Wilfred Spiegelenburg via wang) + BUG FIXES HADOOP-11236. NFS: Fix javadoc warning in RpcProgram.java (Abhiraj Butala via harsh) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableComparator.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableComparator.java index b2738ffa80..35c6ef9a52 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableComparator.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/WritableComparator.java @@ -160,6 +160,7 @@ public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { buffer.reset(b2, s2, l2); // parse key2 key2.readFields(buffer); + buffer.reset(null, 0, 0); // clean up reference } catch (IOException e) { throw new RuntimeException(e); }