OOM from building projects

We are still on gradle 4.10.3. We have android project with 10 modules. It is around 123k lines of java and kotlin code.

We have Linux and Mac build machines. They are quite powerful and have each 32 Gbs of memory. But we constantly see OOM error while trying to build the project.

We have next properties for gradle:
org.gradle.jvmargs=-Xmx4096M -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

We also enabled daemon for gradle on CI.

This is a screenshot of the Linux machine:

Gitlab runner takes GBs memory.

I wonder if it possible to trace issue and find out the cause.

1 Like