From 1b6b88353423c15aee62b8f3d1a081ad67f5a66e Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 17 Aug 2022 18:26:21 +0200 Subject: driver: Increase default -rss_limit_mb With -Xmx512m, the ExampleOutOfMemoryFuzzer ran into this failure on macOS: ==19173== ERROR: libFuzzer: out-of-memory (used: 961Mb; limit: 911Mb) --- driver/src/main/java/com/code_intelligence/jazzer/driver/Driver.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driver/src/main/java/com/code_intelligence/jazzer/driver/Driver.java b/driver/src/main/java/com/code_intelligence/jazzer/driver/Driver.java index 45e7b72e..5b107ad8 100644 --- a/driver/src/main/java/com/code_intelligence/jazzer/driver/Driver.java +++ b/driver/src/main/java/com/code_intelligence/jazzer/driver/Driver.java @@ -103,8 +103,9 @@ public class Driver { // the process including Jazzer's native and non-native memory footprint, such that: // 1. we never reach it purely by allocating memory on the Java heap; // 2. it is still reached if the fuzz target allocates excessively on the native heap. - // As a heuristic, we set the overall memory limit to 2 * the maximum size of the Java heap. + // As a heuristic, we set the overall memory limit to 2 * the maximum size of the Java heap and + // add a fixed 1 GiB on top for the fuzzer's own memory usage. long maxHeapInBytes = Runtime.getRuntime().maxMemory(); - return "-rss_limit_mb=" + (2 * maxHeapInBytes / (1024 * 1024)); + return "-rss_limit_mb=" + ((2 * maxHeapInBytes / (1024 * 1024)) + 1024); } } -- cgit v1.2.3