forked from github-such-software/hash-wallet
Android: bump gradle JVM heap to 10G + cap workers to fix AAB OOM #23
Reference in New Issue
Block a user
Delete Branch "github-such-software/hash-wallet:dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Verbose log of yesterday's AAB build revealed:
java.lang.OutOfMemoryError: Java heap space
at java.util.zip.DeflaterOutputStream.write
at com.android.zipflinger.StreamSource.
at com.android.builder.internal.packaging.AabFlinger$writeZip$1.call
AAB packaging streams compressed native libs through ByteArrayOutputStream
buffers. With universal-bundle (all 3 ABIs in one AAB) and parallel
ForkJoinPool workers all drawing from the same 6G heap, the peak exceeds
budget mid-zip. APK build doesn't hit this because per-ABI APKs are
packaged separately, much smaller per-file working set.
Two changes:
(the daemon-side metaspace also creeps up over a long build).
buffer footprint. Build still parallel, just gentler peak.
Issue Number (if Applicable): Fixes #
Description
Please include a summary of the changes and which issue is fixed / feature is added.
Pull Request - Checklist
Verbose log of yesterday's AAB build revealed: java.lang.OutOfMemoryError: Java heap space at java.util.zip.DeflaterOutputStream.write at com.android.zipflinger.StreamSource.<init> at com.android.builder.internal.packaging.AabFlinger$writeZip$1.call AAB packaging streams compressed native libs through ByteArrayOutputStream buffers. With universal-bundle (all 3 ABIs in one AAB) and parallel ForkJoinPool workers all drawing from the same 6G heap, the peak exceeds budget mid-zip. APK build doesn't hit this because per-ABI APKs are packaged separately, much smaller per-file working set. Two changes: 1) org.gradle.jvmargs: -Xmx6144M → -Xmx10240M, + MaxMetaspaceSize=1024M (the daemon-side metaspace also creeps up over a long build). 2) org.gradle.workers.max=2 — fewer parallel workers = lower simultaneous buffer footprint. Build still parallel, just gentler peak.