Plugin V2 gradle build memory usage

Hi all,
I just noticed a slightly increase of the memory usage moving from traditional plugin to the new modular plugin.

Mainly before without much configuration I was able to build on a CI node with 6 GB of RAM, now I’ve to setup memory quite strictly and move to an 8GB CI node.

The parameter I use are:

org.gradle.jvmargs=-Xmx1536M -XX:MaxMetaspaceSize=512M
kotlin.daemon.jvmargs=-Xmx1536M -XX:MaxMetaspaceSize=512M

Before was

org.gradle.jvmargs=-Xmx4096M

but was not even using all the heap allocated.

I try with both plugin 2.13.1 and plugin 2.14.0 and there is no big differences.

Any suggestion or this could be expected?
On code side, except the changes required by plugin modularization there is no change in feature and implementation.

Best regards,
Mirko

Hi, could you please take a CPU Snapshot / JFR if possible? It would reveal memory allocations as well