Hi,
I have been encountering same issue.
I got "java.lang.OutOfMemoryError: Java heap space" when I tried to compile
my code with ANT.
So, I tried setting ANT_OPTS env var, that doesn't resolve the issue
permanently and the issue occurred intermittently.
Then I tried setting fork attribute in my build.xml, which brought up a
following exception
Error running C:\jdk1.5.0_15\bin\javac.exe compiler
at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:537)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:385)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: java.io.IOException: CreateProcess: C:\jdk1.5.0_15\bin\javac.exe
-J-Xms256m -J-Xmx256m -d C:\target\classes -classpath <classpath>
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:808)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:445)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:459)
at
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:449)
... 33 more
The javac tag I used in my build.xml is:
<javac srcdir="${src}" destdir="${classDst}" debug="${debug}"
fork="yes"
memoryInitialSize="256m"
memoryMaximumSize="256m"
executable="${env.JAVA_HOME}/bin/javac"
source="${compiler.opts.vm.source}"
target="${compiler.opts.vm.target}"
includes="${projectDir}/xxx/**"
excludes="${projectDir}/xxxTest/**" >
<classpath refid="base.path" />
</javac>
I have even tried with following javac tag in build.xml:
<javac srcdir="${src}" destdir="${classDst}" debug="${debug}"
fork="yes"
memoryInitialSize="512m"
memoryMaximumSize="512m"
executable="${env.JAVA_HOME}/bin/javac"
deprecation="off"
optimize="off"
verbose="no"
source="${compiler.opts.vm.source}"
target="${compiler.opts.vm.target}"
includes="${projectDir}/xxx/**"
excludes="${projectDir}/xxx/Test/**" >
<classpath refid="base.path" />
</javac>
Please help me to get rid of this issue, I have been struggling with this
issue for the last 5 days.
Thanks in advance,
_Vino
kermitt wrote:
>
> have you tried to fork and specify the memoryInitialSize and
> memoryMaximumSize?
>
> you should try with another compiler if you were using Sun Javac, try
> jikes or even better eclipse compiler
> (org.eclipse.jdt.core.JDTCompilerAdapter)
>
> my 2cts...
>
>
>
> -----Original Message-----
> From: Ravi Roy [mailto:[email protected]]
> Sent: Monday, December 10, 2007 4:37 PM
> To: [email protected]
> Subject: Frequent java.lang.OutOfMemoryError: Java heap space error
>
> Hello all,
>
> I am running my product build with cruisecontrol using ant 1.7.0. I have
> set
> ANT_OPTS=-Xms=1536m -Xmx1536m, but still I am getting below mentioned
> error,
> I have searched mail archive, but I see ANT_OPTS settings, which I have
> already set, I get the following error :
>
> [javac] The system is out of resources.
> [javac] java.lang.OutOfMemoryError: Java heap space
>
> Am I doing right to set ANT_OPTS variable to increase the heap size ? I am
> running my build machine using Windows XP with 2.0 Gigabyte of physical
> RAM.
>
> Does somebody know how to handle this ? It is more frequent now.
>
> Thanks in adavnace for thoughts.
>
> Regards,
> Ravi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://old.nabble.com/Frequent-java.lang.OutOfMemoryError%3A-Java-heap-space-error-tp14255237p26687265.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]