aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 3037a09..95bc6f9 100755
--- a/build.sh
+++ b/build.sh
@@ -229,7 +229,11 @@ if [ $TARGET_BUILD = "true" ] || [ -n "$DX" ]; then
$CROSS_COMPILE_FLAGS \
"${javac_cmd_options[@]}"
if hash dx 2> /dev/null; then
- verbose_safe dx --dex --output $DIR_BUILD/bench.apk $DIR_BUILD/classes/
+ # Use custom Java options to compile benchmarks that require more memory.
+ export _JAVA_OPTIONS="-Xms512m -Xmx2048m -XX:MaxPermSize=512m"
+ # Use --multi-dex option to avoid hitting 64k limit on number of method references.
+ # Use --min-sdk-version=26 to compile all supported benchmarks.
+ verbose_safe dx --multi-dex --min-sdk-version=26 --dex --output $DIR_BUILD/bench.apk $DIR_BUILD/classes/
else
warning "\`dx\` command not found. bench.apk won't be generated." \
"Are you running from an Android environment?"