How do I give Jenkins more heap space when it's running as a daemon on Ubuntu?

前端 未结 4 1351
名媛妹妹
名媛妹妹 2020-12-02 13:27

My Jenkins jobs are running out of memory, giving java.lang.OutOfMemoryError messages in the build log. But I used the Ubuntu Package Manager, aptitude

4条回答
  •  抹茶落季
    2020-12-02 13:46

    Another method to set the heap size for particular jobs is to use environment variables for each job. This ensures that the memory is available when the job that requires a higher memory is not in use.

    GRADLE_OPTS="-Dorg.gradle.jvmargs=-Xms1024M -Xmx8192M -XX:PermSize=512M -XX:MaxPermSize=2048 -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
    
    JAVA_OPTS="-XX:MaxPermSize=2048M"
    
    

提交回复
热议问题