Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11323

WritableComparator#compare keeps reference to byte array

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.7.0
    • Component/s: performance
    • Labels:
      None

      Description

      When the default compare is used on a WritableComparator a reference to the second passed in byte array is kept in the buffer. Since WritableComparator keeps a reference to the buffer the byte will never be garbage collected. This can lead to a higher heap use than needed.

      The buffer should drop the reference to the byte array passed in. We can null out the byte array reference since the buffer is a private variable for the class.

        Attachments

        1. HADOOP-11323.patch
          0.8 kB
          Wilfred Spiegelenburg

          Activity

            People

            • Assignee:
              wilfreds Wilfred Spiegelenburg
              Reporter:
              wilfreds Wilfred Spiegelenburg
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: