[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ant-user
Subject:    Fwd: Best practises for Ant Memory usage
From:       "Ravi Roy" <ravi.aroy () gmail ! com>
Date:       2008-06-23 7:19:37
Message-ID: 246bcc580806230007m2b2fb070h2bc63808f64af5b1 () mail ! gmail ! com
[Download RAW message or body]

Thanks for your reply, These setting worked and problem is gone ;-)

Create system variable ANT_OPTS and set the value of this to -DXms=1024M
-DXmx=1024M -XX:+UseParallelGC
Hope this would help, I had similar problem, which was solved using
this.


-----Original Message-----
From: Ravi Roy [mailto:ravi.aroy@gmail.com]
Sent: Friday, June 20, 2008 6:55 PM
To: Ant Users List; Henning Bredel
Subject: Re: Best practises for Ant Memory usage

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.jav
a:39)
   [javac]  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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(DelegatingMethodAccessor
Impl.java:25)
   [javac]  at java.lang.reflect.Method.invoke(Method.java:597)
   [javac]  at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
06)
   [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(ProjectHe
lper.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.jav
a:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
06)
 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(DefaultExecut
or.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




DISCLAIMER:
Unless indicated otherwise, the information contained in this message
is privileged and confidential, and is intended only for the use of
the addressee(s) named above and others who have been specifically
authorized to receive it. If you are not the intended recipient, you
are hereby notified that any dissemination, distribution or copying of
this message and/or attachments is strictly prohibited. The company
accepts no liability for any damage caused by any virus transmitted by
this email. Furthermore, the company does not warrant a proper and
complete transmission of this information, nor does it accept
liability for any delays. If you have received this message in error,
please contact the sender and delete the message. Thank you.


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

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic