From 3f5ce7c1d2e03c4fec9b7596a0cc993e2f98b986 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 1 May 2015 11:55:06 +0900 Subject: [PATCH] Reduce the memory requirement of heap dump compression Motivation: The current heap dump compression preset (9) requires way too much memory (768 MiB at maximum for dictionary), resulting in OOME in many cases. Modifications: - Use the default preset (6) which uses 8 MiB dictionary. - Do not fail abruptly even when OOME has been raised. Result: More stable heap dump acquisition --- .../src/main/java/io/netty/testsuite/util/TestUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/src/main/java/io/netty/testsuite/util/TestUtils.java b/testsuite/src/main/java/io/netty/testsuite/util/TestUtils.java index c4070a5060..c7ad4d55fb 100644 --- a/testsuite/src/main/java/io/netty/testsuite/util/TestUtils.java +++ b/testsuite/src/main/java/io/netty/testsuite/util/TestUtils.java @@ -239,7 +239,7 @@ public final class TestUtils { }); final byte[] buf = new byte[65536]; - final LZMA2Options options = new LZMA2Options(9); + final LZMA2Options options = new LZMA2Options(LZMA2Options.PRESET_DEFAULT); for (File file: files) { final String filename = file.toString(); @@ -277,8 +277,8 @@ public final class TestUtils { } out.close(); in.close(); - } catch (Exception e) { - logger.warn("Failed to compress the heap dump: {}", xzFilename, e); + } catch (Throwable t) { + logger.warn("Failed to compress the heap dump: {}", xzFilename, t); } finally { if (in != null) { try {