Hi we have a project with 30 productFlavors which I try to build with jenkins. Since we update (for Android Studio3) to : - gradle 3.0.0 - Build Tools 26.0.2
We get an out of memory exception in Lint :
:app:lintUnexpected failure during lint analysis of null (this is a bug in lint or one of the libraries it depends on)
`OutOfMemoryError:ByteStreams.toByteArray(ByteStreams.java:176)
Files.readFile(Files.java:182)←Files$FileByteSource.read(Files.java:153)
Files.toByteArray(Files.java:252)←LintClient.readBytes(LintClient.kt:249)
ClassEntry.addEntries(ClassEntry.java:216)
ClassEntry.fromClassPath(ClassEntry.java:120)
LintClient.createSuperClassMap(LintClient.kt:997)`
You can set environment variable `LINT_PRINT_STACKTRACE=true` to dump a full stacktrace to stdout. java.lang.OutOfMemoryError: Java heap space at
com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:176) at
com.google.common.io.Files.readFile(Files.java:182) at
com.google.common.io.Files$FileByteSource.read(Files.java:153) at
com.google.common.io.Files.toByteArray(Files.java:252) at
com.android.tools.lint.client.api.LintClient.readBytes(LintClient.kt:249)
I increased the Gradle Memory (gradle.properties org.gradle.jvmargs=-Xmx3098M) with out success.
All productFlavors have the same java code. The result apk has different Images, Package Name, Languages and configuration.
The build run for 25 productFlavors until we get out of memory. With the ps command I see JVM options for client processes of Gradle Daemon like : java -Djava.awt.headless=true -Xmx64M com.google.devtools.build.android.desugar.Desugar I have no idea how to set JVM options this child processes (Android Tools)
Maybe it is al memory leak in the gradle daemon. I observe in the first 20 build of my productFlavors the head is about 2G and than it increase to 3G and the gradle deamon jvm is doing GC all the time...
Any idea or suggestions ?
Regards