From 6279f164d3f4ca9b74852a38037288fff4af8cfd Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Thu, 22 Jul 2021 12:28:13 +0200 Subject: Lower default -Xmx setting The -Xmx setting does not account for the following additional heap usage that is included in the RSS limit maintained by libFuzzer: - Metaspace, which contains Java class metadata and is on the order of 25 MB for the Jazzer examples. - Jazzer coverage counters By lowering the default -Xmx setting, we make it less likely that a target crashes with a libFuzzer OOM. --- driver/jvm_tooling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'driver') diff --git a/driver/jvm_tooling.cpp b/driver/jvm_tooling.cpp index a0ccb6ac..7cd84faf 100644 --- a/driver/jvm_tooling.cpp +++ b/driver/jvm_tooling.cpp @@ -197,7 +197,7 @@ JVM::JVM(const std::string &executable_path) { JavaVMOption{.optionString = const_cast(class_path.c_str())}); // Set the maximum heap size to a value that is slightly smaller than // libFuzzer's default rss_limit_mb. This prevents erroneous oom reports. - options.push_back(JavaVMOption{.optionString = (char *)"-Xmx2040m"}); + options.push_back(JavaVMOption{.optionString = (char *)"-Xmx1800m"}); options.push_back(JavaVMOption{.optionString = (char *)"-enableassertions"}); // Preserve and emit stack trace information even on hot paths. // This may hurt performance, but also helps find flaky bugs. -- cgit v1.2.3