ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi Roy" <ravi.a...@gmail.com>
Subject Re: Best practises for Ant Memory usage
Date Fri, 20 Jun 2008 13:24:56 GMT
Hi,
Thanks for your reply Henning. Yes, javac causes memory error,
following is the error message. I am using Sun JDK 1.6.0_03-b05.
_________________________________________________________________________________
compile:
    [javac] Compiling 4 source files to d:\Build\iPiece\Java\iTool\bin
    [javac]
    [javac]
    [javac] The system is out of resources.
    [javac] Consult the following stack trace for details.
    [javac] java.lang.OutOfMemoryError: Java heap space
    [javac]  at com.sun.tools.javac.util.Name.fromChars(Name.java:115)
    [javac]  at com.sun.tools.javac.util.Name.fromString(Name.java:144)
    [javac]  at com.sun.tools.javac.util.Name.fromString(Name.java:150)
    [javac]  at com.sun.tools.javac.util.Name$Table.fromString(Name.java:529)
    [javac]  at
com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:510)
    [javac]  at
com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1565)
    [javac]  at
com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1443)
    [javac]  at
com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:618)
    [javac]  at
com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1289)
    [javac]  at
com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1259)
    [javac]  at
com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765)
    [javac]  at
com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
    [javac]  at com.sun.tools.javac.main.Main.compile(Main.java:353)
    [javac]  at com.sun.tools.javac.main.Main.compile(Main.java:279)
    [javac]  at com.sun.tools.javac.main.Main.compile(Main.java:270)
    [javac]  at com.sun.tools.javac.Main.compile(Main.java:69)
    [javac]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [javac]  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [javac]  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [javac]  at java.lang.reflect.Method.invoke(Method.java:597)
    [javac]  at
org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
    [javac]  at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
    [javac]  at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
    [javac]  at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    [javac]  at sun.reflect.GeneratedMethodAccessor179.invoke(Unknown Source)
    [javac]  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [javac]  at java.lang.reflect.Method.invoke(Method.java:597)
    [javac]  at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [javac]  at org.apache.tools.ant.Task.perform(Task.java:348)
    [javac]  at org.apache.tools.ant.Target.execute(Target.java:357)
    [javac]  at org.apache.tools.ant.Target.performTasks(Target.java:385)
    [javac]  at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

BUILD FAILED

D:\Build\iPiece\build.xml:209: The following error occurred while
executing this line:
d:\Build\Ant\Main-Targets.xml:9: The following error occurred while
executing this line:
d:\Build\Ant\Main-Targets.xml:32: The following error occurred while
executing this line:
d:\Build\iPiece\Java\iTool\build_itool.xml:23: Compile failed; see the
compiler error output for details.
 at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
 at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
 at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
 at org.apache.tools.ant.Task.perform(Task.java:348)
 at org.apache.tools.ant.Target.execute(Target.java:357)
 at org.apache.tools.ant.Target.performTasks(Target.java:385)
 at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
 at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
 at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
 at org.apache.tools.ant.Main.runBuild(Main.java:758)
 at org.apache.tools.ant.Main.startAnt(Main.java:217)
 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
_________________________________________________________________________________

I have set ANT_OPTS to -DXms=1536m -DXmx=1536m , earlier it was set to 1024m.

Thanks.
Regards,
Ravi.


On Fri, Jun 20, 2008 at 4:33 PM, Henning Bredel <h.bredel@gmx.de> wrote:
>> From time to time, I get Out-Of-Memory errors in Ant (Ant 1.7.0), I
>> would like to know the best practises from the people who have
>> experience with Ant Memory Management. Some set of tips & tricks..
>> would help every one here..
>
> Are you sure, that ant causes the memory error? For example
> it could be the javac command which runs out of heap size . . .
>
> Please attach an error message to give a hint, what the Out-
> of-Memory error causes.
>
> Regards
>
>  Henning
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message