Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.0
-
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.