mirror of https://github.com/apache/kafka.git
Call `compressor.close()` to fix memory leak
This commit is contained in:
parent
5311e5b10f
commit
515040ba45
|
@ -147,7 +147,11 @@ public final class Record {
|
||||||
// construct the compressor with compression type none since this function will not do any
|
// construct the compressor with compression type none since this function will not do any
|
||||||
//compression according to the input type, it will just write the record's payload as is
|
//compression according to the input type, it will just write the record's payload as is
|
||||||
Compressor compressor = new Compressor(buffer, CompressionType.NONE);
|
Compressor compressor = new Compressor(buffer, CompressionType.NONE);
|
||||||
compressor.putRecord(timestamp, key, value, type, valueOffset, valueSize);
|
try {
|
||||||
|
compressor.putRecord(timestamp, key, value, type, valueOffset, valueSize);
|
||||||
|
} finally {
|
||||||
|
compressor.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void write(Compressor compressor, long crc, byte attributes, long timestamp, byte[] key, byte[] value, int valueOffset, int valueSize) {
|
public static void write(Compressor compressor, long crc, byte attributes, long timestamp, byte[] key, byte[] value, int valueOffset, int valueSize) {
|
||||||
|
|
Loading…
Reference in New Issue