def checkTotalMemory()

in src/main/script/prerequisiteCheckFramework.groovy [29:48]


def checkTotalMemory(long requiredMaxMegs) {
    print "Checking available memory:               "
    long curMaxMegs = (long) (Runtime.runtime.maxMemory() / (1024*1024))
    if(curMaxMegs < requiredMaxMegs) {
        println "Failed:"
        println ""
        println "Too little memory available. "
        println "Please set the MAVEN_OPTS environment variable to allow at least " + requiredMaxMegs + "MB of ram."
        println "Example:"
        if(os == "win") {
            println "set MAVEN_OPTS=-Xmx" + requiredMaxMegs + "m"
        } else {
            println "export MAVEN_OPTS=-Xmx" + requiredMaxMegs + "m"
        }
        println ""
        allConditionsMet = false
    } else {
        println "OK (" + curMaxMegs + " MB)"
    }
}