Error: Java heap space

ido.ran's Avatar

ido.ran

17 Aug, 2014 03:38 PM

Hi,
I have a problem that only on my CI server I get Java heap space exception.
Please see the complete trace bellow, I can create a log with -debug switch if it will help.

I found a thread that say it a problem with dependent library libjarjar-java but how come it doesn't manifest itself on my own machine (Mac)?

This is the CI server gradle info:

------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------

Build time:   2014-02-11 11:34:39 UTC
Build number: none
Revision:     a831fa866d46cbee94e61a09af15f9dd95987421

Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:          2.2.0
JVM:          1.7.0_67 (Oracle Corporation 24.65-b04)
OS:           Windows Server 2012 R2 6.3 x86

Detailed Log


pgameBuilding in workspace c:\temp\jenkins\pgameTown-build\workspace
 > git.exe rev-parse --is-inside-work-tree # timeout=60
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url git@bitbucket.org:comp/pgame_town2.git # timeout=60
Cleaning workspace
 > git.exe rev-parse --verify HEAD # timeout=60
Resetting working tree
 > git.exe reset --hard # timeout=60
 > git.exe clean -fdx # timeout=60
 > git.exe submodule foreach --recursive git reset --hard # timeout=60
 > git.exe submodule foreach git clean -fdx # timeout=60
Fetching upstream changes from git@bitbucket.org:comp/pgame_town2.git
 > git.exe --version # timeout=60
 > git.exe fetch --tags --progress git@bitbucket.org:comp/pgame_town2.git +refs/heads/*:refs/remotes/origin/* # timeout=60
 > git.exe rev-parse "origin/gradle^{commit}" # timeout=60
Checking out Revision 365e90bd27401095c40bef6ac1b217b1ef8f728e (origin/gradle)
 > git.exe config core.sparsecheckout # timeout=60
 > git.exe checkout -f 365e90bd27401095c40bef6ac1b217b1ef8f728e # timeout=60
 > git.exe rev-list 365e90bd27401095c40bef6ac1b217b1ef8f728e # timeout=60
 > git.exe remote # timeout=60
 > git.exe submodule init # timeout=60
 > git.exe submodule sync # timeout=60
 > git.exe config --get remote.origin.url # timeout=60
 > git.exe submodule update
[Gradle] - Launching build.
Unpacking http://services.gradle.org/distributions/gradle-1.11-bin.zip to C:\CI\Jenkins\tools\hudson.plugins.gradle.GradleInstallation\gradle_1.11 on Jenkins
[workspace] $ cmd.exe /C '"C:\CI\Jenkins\tools\hudson.plugins.gradle.GradleInstallation\gradle_1.11\bin\gradle.bat -info clean compileFlex && exit %%ERRORLEVEL%%"'
Starting Build
Compiling settings file 'C:\temp\jenkins\pgameTown-build\workspace\settings.gradle' using StatementExtractingScriptTransformer.
Compiling settings file 'C:\temp\jenkins\pgameTown-build\workspace\settings.gradle' using BuildScriptTransformer.
Settings evaluated using settings file 'C:\temp\jenkins\pgameTown-build\workspace\settings.gradle'.
Projects loaded. Root project using build file 'C:\temp\jenkins\pgameTown-build\workspace\build.gradle'.
Included projects: [root project 'workspace', project ':CreateMode/CreateModePlayer', project ':include/compportal_air']
Evaluating root project 'workspace' using build file 'C:\temp\jenkins\pgameTown-build\workspace\build.gradle'.
Compiling build file 'C:\temp\jenkins\pgameTown-build\workspace\build.gradle' using StatementExtractingScriptTransformer.
Download http://repo1.maven.org/maven2/org/gradlefx/gradlefx/0.8.3/gradlefx-0.8.3.pom
Download http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.8.6/groovy-all-1.8.6.pom
Download http://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.pom
Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/17/commons-parent-17.pom
Download http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom
Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.jar]
Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/org/apache/commons/commons-parent/17/commons-parent-17.jar]
Download http://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/25/commons-parent-25.pom
Download http://repo1.maven.org/maven2/org/apache/apache/9/apache-9.pom
Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/org/apache/apache/9/apache-9.jar]
Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/org/apache/commons/commons-parent/25/commons-parent-25.jar]
Download http://repo1.maven.org/maven2/org/gradlefx/gradlefx/0.8.3/gradlefx-0.8.3.jar
Download http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.8.6/groovy-all-1.8.6.jar
Download http://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Download http://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar
Compiling build file 'C:\temp\jenkins\pgameTown-build\workspace\build.gradle' using BuildScriptTransformer.
air-sdk
C:\CI\FlexSDK\Flex4.12.1_AIR13.0
Determining SDK install location
Determining SDK install location
Evaluating project ':CreateMode/CreateModePlayer' using build file 'C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\build.gradle'.
Compiling build file 'C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\build.gradle' using StatementExtractingScriptTransformer.
Compiling build file 'C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\build.gradle' using BuildScriptTransformer.
Determining SDK install location
Determining SDK install location
Evaluating project ':include/compportal_air' using build file 'C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\build.gradle'.
Compiling build file 'C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\build.gradle' using StatementExtractingScriptTransformer.
Compiling build file 'C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\build.gradle' using BuildScriptTransformer.
Determining SDK install location
Determining SDK install location
All projects evaluated.
Selected primary tasks 'clean', 'compileFlex'
Tasks to be executed: [task ':clean', task ':CreateMode/CreateModePlayer:clean', task ':include/compportal_air:clean', task ':copyresources', task ':CreateMode/CreateModePlayer:compileFlex', task ':include/compportal_air:compileFlex', task ':compileFlex']
:clean (Thread[main,5,main]) started.
:clean
Executing task ':clean' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
:clean (Thread[main,5,main]) completed. Took 0.012 secs.
:CreateMode/CreateModePlayer:clean (Thread[main,5,main]) started.
:CreateMode/CreateModePlayer:clean
Executing task ':CreateMode/CreateModePlayer:clean' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
:CreateMode/CreateModePlayer:clean UP-TO-DATE
:CreateMode/CreateModePlayer:clean (Thread[main,5,main]) completed. Took 0.0 secs.
:include/compportal_air:clean (Thread[main,5,main]) started.
:include/compportal_air:clean
Executing task ':include/compportal_air:clean' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
:include/compportal_air:clean UP-TO-DATE
:include/compportal_air:clean (Thread[main,5,main]) completed. Took 0.0 secs.
:copyresources (Thread[main,5,main]) started.
:copyresources
Executing task ':copyresources' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
from C:\temp\jenkins\pgameTown-build\workspace\src\main\resources to C:\temp\jenkins\pgameTown-build\workspace\build
:copyresources (Thread[main,5,main]) completed. Took 0.123 secs.
:CreateMode/CreateModePlayer:compileFlex (Thread[main,5,main]) started.
:CreateMode/CreateModePlayer:compileFlex
Executing task ':CreateMode/CreateModePlayer:compileFlex' (up-to-date check took 0.391 secs) due to:
  No history is available.
Compiling with compc
    -load-config=
    -external-library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0/frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc
    -source-path+=C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\src
    -include-sources+=C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\src
    -external-library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\air\airglobal.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\DragonBones-2.4.1-fix.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\feathers.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\Gunk.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\starling-1.5.1.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\appsee-analytics\Appsee-2.08.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\as3corelib\as3corelib.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\facebook\GraphAPI_Mobile_1_8_1.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\facebook\OpenURL.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\mockito\mockito-1.4M5.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\comp_sdk\compSDK_AIR.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\core.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\OSMF.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\textLayout.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\authoringsupport.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\air\servicemonitor.swc
    -target-player=13.0
    -output=C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\build\CreateMode\CreateModePlayer.swc
[compc] C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\src\com\comp\adventuretown\util\StringBuilder.as(6): col: 15 Warning: No constructor function was specified for class StringBuilder.

    public class StringBuilder
                 ^

C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\build\CreateMode\CreateModePlayer.swc (2129810 bytes)
:CreateMode/CreateModePlayer:compileFlex (Thread[main,5,main]) completed. Took 10.295 secs.
:include/compportal_air:compileFlex (Thread[main,5,main]) started.
:include/compportal_air:compileFlex
Executing task ':include/compportal_air:compileFlex' (up-to-date check took 0.028 secs) due to:
  No history is available.
Compiling with compc
    -load-config=
    -external-library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0/frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc
    -source-path+=C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\src
    -include-sources+=C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\src
    -external-library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\air\airglobal.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\core.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\OSMF.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\textLayout.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\authoringsupport.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\air\servicemonitor.swc
    -target-player=13.0
    -output=C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\build\include\compportal_air.swc
[compc] C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\build\include\compportal_air.swc (14116 bytes)
:include/compportal_air:compileFlex (Thread[main,5,main]) completed. Took 4.595 secs.
:compileFlex (Thread[main,5,main]) started.
:compileFlex
Executing task ':compileFlex' (up-to-date check took 7.859 secs) due to:
  No history is available.
Compiling with mxmlc
    +configname=flex
    -load-config=
    -external-library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0/frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc
    -source-path+=C:\temp\jenkins\pgameTown-build\workspace\src
    -external-library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\air\airglobal.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\DragonBones-2.4.1-fix.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\feathers.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\Gunk.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\starling-1.5.1.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\appsee-analytics\Appsee-2.08.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\as3corelib\as3corelib.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\facebook\GraphAPI_Mobile_1_8_1.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\facebook\OpenURL.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\mockito\mockito-1.4M5.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\lib\comp_sdk\compSDK_AIR.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\core.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\OSMF.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\textLayout.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\authoringsupport.swc
    -library-path+=C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\libs\air\servicemonitor.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\createmode\CreateModePlayer\build\CreateMode\CreateModePlayer.swc
    -library-path+=C:\temp\jenkins\pgameTown-build\workspace\include\compportal_air\build\include\compportal_air.swc
    -target-player=13.0
    -swf-version=24
    -load-config=C:\CI\FlexSDK\Flex4.12.1_AIR13.0/frameworks/air-config.xml
    -output=C:\temp\jenkins\pgameTown-build\workspace\build\workspace.swf
    C:\temp\jenkins\pgameTown-build\workspace\src\AdventureTown.as
[ant:java] Java Result: 1
:compileFlex FAILED
:compileFlex (Thread[main,5,main]) completed. Took 31.592 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileFlex'.
> java.lang.Exception: mxmlc execution failed: Loading configuration file C:\CI\FlexSDK\Flex4.12.1_AIR13.0\frameworks\air-config.xml
  Error: Java heap space
  


* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 7.474 secs
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
  1. Support Staff 1 Posted by Yennick Trevels on 17 Aug, 2014 03:42 PM

    Yennick Trevels's Avatar

    You'll probably have to tweak the heap size that is used when executing the mxmlc compiler. You can do this with the 'jvmArguments' property, like this:

    jvmArguments = [
        '-Xmx2048m',
        '-Xms512m' 
    ]
    
  2. 2 Posted by ido.ran on 17 Aug, 2014 03:50 PM

    ido.ran's Avatar

    My machine has 1.75GB so I reduce Xmx to 1024m.
    I forgot to include the link to the issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744337
    How can I update groovy to version to 1.8.6-3 which they claim to fix the issue in?

  3. 3 Posted by ido.ran on 17 Aug, 2014 05:19 PM

    ido.ran's Avatar

    Is there a way to change the dependency on groovy so it will download a newer version than 1.8.6 ?

  4. Support Staff 4 Posted by Yennick Trevels on 17 Aug, 2014 06:43 PM

    Yennick Trevels's Avatar

    I'm quite sure this problem isn't related to a bug in Groovy. The reason you're getting this error is because GradleFx starts the Mxmlc compiler in a different Java process. In some situations this java process might not have enough heap space by default. Therefore we have the 'jvmArguments' property which allows you to increase the heap size.

  5. 5 Posted by ido.ran on 17 Aug, 2014 07:44 PM

    ido.ran's Avatar

    You are right once again.
    Adding jvmArguments = ['-Xmx1024m','-Xms512m'] to the main project build.gradle solve the problem.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

24 Mar, 2017 07:10 PM
19 Mar, 2017 04:39 AM
22 Jan, 2017 07:46 AM
11 Oct, 2016 01:18 PM
20 Sep, 2016 04:36 PM

 

06 Sep, 2016 08:05 PM
03 Aug, 2016 11:15 AM
01 Jun, 2016 05:20 PM
03 May, 2016 09:17 PM
07 Apr, 2016 07:43 AM
24 Mar, 2016 05:55 PM