aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/src/main/java/com/code_intelligence/jazzer/driver/Driver.java5
1 files 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);
}
}