[Out of memory: Java heap space] {build.status.text}

Hi Teamcity,


When trying to run our ant build, towards the end of the build I get thrown a [Out of memory: Java heap space] error.



[18:30:19]: [Out of memory: Java heap space] {build.status.text}
[18:30:19]: [Out of memory: Java heap space] {build.status.text}


I have attached the build log for this.



In the build log it throws this error:


[12:47:41]:         [gwtcompile] [ERROR] Unexpected
[12:47:41]:         [gwtcompile] java.lang.OutOfMemoryError: Java heap space
[12:47:41]:         [gwtcompile]     at java.util.Arrays.copyOf(Arrays.java:2882)
[12:47:41]:         [gwtcompile]     at java.lang.String.<init>(String.java:179)
[12:47:41]:         [gwtcompile]     at org.eclipse.jdt.core.compiler.CharOperation.charToString(CharOperation.java:685)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.CompiledClass.<init>(CompiledClass.java:72)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.CompilationUnit$FindTypesInCud.visit(CompilationUnit.java:246)
[12:47:41]:         [gwtcompile]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1198)
[12:47:41]:         [gwtcompile]     at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:687)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.CompilationUnit.getCompiledClasses(CompilationUnit.java:424)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:107)
[12:47:41]:         [gwtcompile]     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:266)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.CompilationState.compile(CompilationState.java:189)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.CompilationState.refresh(CompilationState.java:178)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:93)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:264)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.Precompile.precompile(Precompile.java:283)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.Compiler.run(Compiler.java:170)
[12:47:41]:         [gwtcompile]     at dk.contix.ant.gwt.GWT16Compile$1.run(GWT16Compile.java:43)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
[12:47:41]:         [gwtcompile]     at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
[12:47:41]:         [gwtcompile]     at dk.contix.ant.gwt.GWT16Compile.execute(GWT16Compile.java:50)
[12:47:41]:         [gwtcompile]     at dk.contix.ant.gwt.GWTCompileTask.execute(GWTCompileTask.java:136)
[12:47:41]:         [gwtcompile]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[12:47:41]:         [gwtcompile]     at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
[12:47:41]:         [gwtcompile]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[12:47:41]:         [gwtcompile]     at java.lang.reflect.Method.invoke(Method.java:597)
[12:47:41]:         [gwtcompile]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[12:47:41]:         [gwtcompile]     at org.apache.tools.ant.Task.perform(Task.java:348)
[12:47:41]:         [gwtcompile]     at org.apache.tools.ant.Target.execute(Target.java:357)
[12:47:41]:         [gwtcompile]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[12:47:41]:         [gwtcompile]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[12:47:41]:         [gwtcompile]     at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[12:47:41]:         [gwtcompile]    [ERROR] Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)


Please advise on how i can  increase the amount of memory





Attachment(s):
Prime_Services_Inventory_WEBBROWSER_2306.log.txt.zip
threadDump-2011-02-02_13.16.59.txt.zip
0
6 comments

Hi

You can set these options in Ant runner settings.

Michael

0
Avatar
Permanently deleted user

Hi Michael,

I have changed this and still get the [Out of memory: Java heap space] {build.status.text} error..

Please advise.

Arun



Attachment(s):
TeamcityAntBuild.png
0
Avatar
Permanently deleted user

Hi Michael,

This has resolved this issue, thanks

Arun.

0
Avatar
Permanently deleted user

Hi Arun,

I am also facing same issue, for me setting JVM arguments didn;t worked. Any help ? Did you anything more to resolve it ? We are using TC 6.0.1 version.
Even the  addiotion of -XX:+HeapDumpOnOutOfMemoryError param is not helping to debug, no file is created for debug

Here is error:


[15:42:21]: [mail] Sending email: Hotfix Build 7.5.2 HF 10 build no. 690 is SUCESSFULL
[15:42:21]: [mail] Sent email with 1 attachment
[15:42:21]: Process exited with code 0
[15:42:21]: [Out of memory: Java heap space] {build.status.text}
[15:42:21]: [Out of memory: Java heap space] {build.status.text}
[15:42:21]: Publishing artifacts (running for 9h:58m:40s)
[15:42:21]: [Publishing artifacts] Paths to publish: [teamcity-info.xml]
[15:42:21]: [Publishing artifacts] Sending files
[15:42:21]: Build finished



Following is JVM settings in ant build step :

-Xms768m -Xmx1536m -XX:PermSize=256m -XX:MaxPermSize=512m


Following is JVM settings in agent.sh script:

TEAMCITY_AGENT_MEM_OPTS="-Xms1024m -Xmx1536m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError

Regards,
Chetan

0

Please move HeapDumpOnOutOfMemoryError option to Ant settings.
hprof dump should be generated in work directory of your build.

0
Avatar
Permanently deleted user

Hi Michael ,

Thanks for your reply. I was able to resolve it. The OOM issue was coming while JSP compilation was Weblogic 10 application server. But through TC error meesage, we were unable to figure it. Later doing the build manually on another machine we got the proper error message.

Regards,
Chetan

0

Please sign in to leave a comment.