-
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
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.