I recommend giving the thumbs up on this issue:
https://github.com/gradle/gradle/issues/19936
Gradle Enterprise is not a memory profiling tool but you can use a memory profiling tool in combination with the Gradle Profiler to identify the usage just like you would for any other java process.