[SOLVED] GRADLE: HOW TO INCREASE THE JAVA COMPILER’S AVAILABLE HEAP MEMORY

in #java8 years ago

The documentation is not very clear on what all the available options are…
after much Googling and many different attempts finally figured out how to raise the maximum heap of the compiler from within the gradle.build script.

apply plugin: ‘java’

compileJava {
    //raise heap
    options.fork = ‘true’
    options.forkOptions.with {
        memoryMaximumSize = “2048m”
    }
}

Update:
So I’ve noticed this works great on MacOSX, but it doesn’t work at all on Windows 8.

The solution to increasing the JVM’s Heap has been to remove those options from gradle.build script and add a new file on the same folder as where your gradle.build file lives called ‘gradle.properties’

These are the contents that made it work for both Mac and Windows (I’ve still not tested this on my linux box)

org.gradle.jvmargs=-Xms256m -Xmx1024m

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 57740.57
ETH 3127.01
USDT 1.00
SBD 2.33