Increase errorprone heap size
Increase the size of the errorprone heap to fix OOM exceptions.
Bug: 221480398
Test: forrest
Change-Id: Ia74fd4ecc57f08bcbaa1388e0734ee0cce8ae1a4
diff --git a/java/config/config.go b/java/config/config.go
index ea2f934..39584cb 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -68,6 +68,12 @@
pctx.StaticVariable("JavacHeapSize", "2048M")
pctx.StaticVariable("JavacHeapFlags", "-J-Xmx${JavacHeapSize}")
+
+ // ErrorProne can use significantly more memory than javac alone, give it a higher heap
+ // size (b/221480398).
+ pctx.StaticVariable("ErrorProneHeapSize", "4096M")
+ pctx.StaticVariable("ErrorProneHeapFlags", "-J-Xmx${ErrorProneHeapSize}")
+
pctx.StaticVariable("DexFlags", "-JXX:OnError='cat hs_err_pid%p.log' -JXX:CICompilerCount=6 -JXX:+UseDynamicNumberOfGCThreads")
pctx.StaticVariable("CommonJdkFlags", strings.Join([]string{