Zoltan Borok-Nagy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/19282
Change subject: IMPALA-11753: CatalogD OOMkilled due to natively allocated memory ...................................................................... IMPALA-11753: CatalogD OOMkilled due to natively allocated memory CatalogD can be OOMKilled due to too mucn natively allocated memory. The bug is due to a misuse of a Java compression API: https://bugs.openjdk.org/browse/JDK-8257032 The problem is that we creating our own Deflater object and pass it to the constructor of DeflaterOutputStream: https://github.com/apache/impala/blob/84fa6d210d3966e5ece8b4ac84ff8bd8780dec4e/fe/src/main/java/org/apache/impala/util/CompressionUtil.java#L47 This means that Java's DeflaterOutputStream won't assume ownership on the Deflater, and won't invoke its end() method: * https://github.com/openjdk/jdk/blob/a249a52501f3cd7d4fbe5293d14ac8d0d6ffcc69/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java#L144 * https://github.com/openjdk/jdk/blob/a249a52501f3cd7d4fbe5293d14ac8d0d6ffcc69/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java#L246-L247 The Deflater's methods are implemented in C and allocate native memory. This means that until the GC doesn't destroy the unreachable Deflater objects they can consume quite much native memory. In some scenarios it can even result in OOMKills by the kernel. The fix is to override the DeflaterOutputStream's close() method so it invokes end() on the Deflater object. Change-Id: I663a21f60871e32d2d0100ea03d92fd8ab460691 --- M fe/src/main/java/org/apache/impala/util/CompressionUtil.java 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/82/19282/1 -- To view, visit http://gerrit.cloudera.org:8080/19282 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I663a21f60871e32d2d0100ea03d92fd8ab460691 Gerrit-Change-Number: 19282 Gerrit-PatchSet: 1 Gerrit-Owner: Zoltan Borok-Nagy <borokna...@cloudera.com>