You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Z W <mp...@gmail.com> on 2008/02/15 12:05:15 UTC
How to increase memory used by JVM in Ant
Hi
What's the complete command string example to increase memory used by JVM in
Ant 1.7 ?
What's the min and max memory size for this ?
Thanks
Re: How to increase memory used by JVM in Ant
Posted by Tommy Nordgren <to...@comhem.se>.
On 15 feb 2008, at 12.05, Z W wrote:
> Hi
>
> What's the complete command string example to increase memory used
> by JVM in
> Ant 1.7 ?
> What's the min and max memory size for this ?
>
> Thanks
You should set the environment variable ANT_OPTS to contain the
settings needed by the Java virtual Machine.
See the man pages for Java for the necessary options.
(Type man java in a shell window)
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
tommy.nordgren@comhem.se
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: How to increase memory used by JVM in Ant
Posted by glenn opdycke-hansen <gl...@gmail.com>.
If it is a heap size issue, then you might want to get a verbose gc trace.
--glenn
Re: How to increase memory used by JVM in Ant
Posted by glenn opdycke-hansen <gl...@gmail.com>.
Just a guess, but perhaps you need to log or record the depth of the calls.
There may be a logic situation and not a heap size issue.
--glenn
On Feb 16, 2008 12:18 AM, Z W <mp...@gmail.com> wrote:
> Hi Glenn
>
> In one of my previous post, I got jstack error when 2 targets are calling
> each other.
> I have 2 targets namely A, B.
> Target A calls target B. Inside target A has an if-then-else condition
> that
> would stop calling target B if condition is met.
> Target B calls target A every 2 seconds after performing a check.
>
> When running this, after less than a few mins, I got jstack overflow
> error.
> I'm not sure what causes the error and I thought it might be memory.
> Is there a max of "stack frames" allowed in Ant.
>
> Thanks
>
Re: How to increase memory used by JVM in Ant
Posted by Raja Nagendra Kumar <Na...@tejasoft.com>.
Add this line in ant.bat first line..
set ANT_OPTS=-Xms256m -Xmx1024m -XX:MaxPermSize=120m
Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
--
View this message in context: http://www.nabble.com/How-to-increase-memory-used-by-JVM-in-Ant-tp15499056p22308173.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: How to increase memory used by JVM in Ant
Posted by Hariharasudhan R <ha...@gmail.com>.
Hi,
This is most likely a logic/programming error.
Target A calls Target B which in turn calls Target A which again calls
Target B..
Target A -> Target B -> Target A -> Target B..........
This sets up an infinite recursion, which will result in a
StackOverFlowError..
You can increase the stack size by adding the -Xoss JVM parameter, but this
will not help.
It will only delay the StackOverFlowError till the now larger stack fills
up.
This will not happen only if there you have set some exit condition which
will not continue the recursive call
(This is what you would do when you write a recursive function in any
programming language )
HTH,
Hari
On Feb 16, 2008 11:48 AM, Z W <mp...@gmail.com> wrote:
> Hi Glenn
>
> In one of my previous post, I got jstack error when 2 targets are calling
> each other.
> I have 2 targets namely A, B.
> Target A calls target B. Inside target A has an if-then-else condition
> that
> would stop calling target B if condition is met.
> Target B calls target A every 2 seconds after performing a check.
>
> When running this, after less than a few mins, I got jstack overflow
> error.
> I'm not sure what causes the error and I thought it might be memory.
> Is there a max of "stack frames" allowed in Ant.
>
> Thanks
>
Re: How to increase memory used by JVM in Ant
Posted by Z W <mp...@gmail.com>.
Hi Glenn
In one of my previous post, I got jstack error when 2 targets are calling
each other.
I have 2 targets namely A, B.
Target A calls target B. Inside target A has an if-then-else condition that
would stop calling target B if condition is met.
Target B calls target A every 2 seconds after performing a check.
When running this, after less than a few mins, I got jstack overflow error.
I'm not sure what causes the error and I thought it might be memory.
Is there a max of "stack frames" allowed in Ant.
Thanks
Re: How to increase memory used by JVM in Ant
Posted by glenn opdycke-hansen <gl...@gmail.com>.
Why do you need to alter the heap memory use by the JVM for Ant?
Is there a problem that you are dealing with?
Why do you want to do this via a command?
I would set the ANT_OPTS as an environment variable, but you could set it
via a command, too.
I have done so below and made the initial heap so large that the call to ant
resulted in an error. This was intentional to see that the memory setting
was effective.
D:\>set ANT_OPTS=-Xms3000m
D:\>ant -diagnostics
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
--glenn
Re: How to increase memory used by JVM in Ant
Posted by Z W <mp...@gmail.com>.
Scott
thanks for your response.
Could someone provide the specific command line option I could use ?
Advance Thanks
On Feb 15, 2008 9:09 AM, Scot P. Floess <fl...@mindspring.com> wrote:
> I think you define ANT_OPTS if I remember correctly...but do so with the
> normal Java -Xmx -Xms options...
>
> Z W wrote:
> > Hi
> >
> > What's the complete command string example to increase memory used by
> JVM in
> > Ant 1.7 ?
> > What's the min and max memory size for this ?
> >
> > Thanks
> >
> >
>
> --
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC 27549
>
> 252-478-8087 (Home)
> 919-754-4592 (Work)
>
> Chief Architect JPlate http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>
> Architect Keros http://sourceforge.net/projects/keros
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: How to increase memory used by JVM in Ant
Posted by "Scot P. Floess" <fl...@mindspring.com>.
I think you define ANT_OPTS if I remember correctly...but do so with the
normal Java -Xmx -Xms options...
Z W wrote:
> Hi
>
> What's the complete command string example to increase memory used by JVM in
> Ant 1.7 ?
> What's the min and max memory size for this ?
>
> Thanks
>
>
--
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Architect Keros http://sourceforge.net/projects/keros
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: How to increase memory used by JVM in Ant
Posted by KKnautiyal <kr...@gmail.com>.
Hi All,
There are two way to increase memory size for ant:
1. Setting the value of ANT_OPTS property in environment var. eg: ANT_OPTS
= -Xmx512M.
2. Specifying maxmeory attribute in in ant Java target.
ex.
target name="MergingHugeJars" >
<echo message="Merging jars ${InputJars} into ${OutputJar}"/>
<java jvm="${JVM}" classname="com.krishna.test.MergeHugeJars"
fork="true" failonerror="true" maxmemory="512m" >
<arg line="${OutputJar} ${InputJars}"/>
</java>
</target>
Here maxmemory is the way to pass the maxmemory to JVM at run time.
Thanks & Regards,
Krishna
zw wrote:
>
> Hi
>
> What's the complete command string example to increase memory used by JVM
> in
> Ant 1.7 ?
> What's the min and max memory size for this ?
>
> Thanks
>
>
--
View this message in context: http://www.nabble.com/How-to-increase-memory-used-by-JVM-in-Ant-tp15499056p24864542.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org