You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Markus M. May" <mm...@gmx.net> on 2006/10/19 16:43:54 UTC

antcall / depends

Hello,
I am currently facing a massive OutOfMemoryException problem. I know that this is, because we are using ANTCALL quite heavily. 
We have e.g. the following structure:

TargetA
  depends on init (via depend)
  calls TargetB and TargetC (via antcall)
TargetB
  depends on init (via depend)
TargetC
  depends on init (via depend)

Therefor for each antcall we call the target init. Since there are taskdefs in the init-target, there is quite some memory leak. Is there some way, to not call the depends, once they are called, another time? 
I know, that we should restructure our build, but currently we are facing a timely issue, so this is not an option anyway :-(

Any help is appreciated.

R,

Markus M. May

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


Re: antcall / depends

Posted by Peter Reilly <pe...@gmail.com>.
On 10/24/06, Markus M. May <mm...@gmx.net> wrote:
> So, after I did some restructuring (we throw out some depend-attributes on targets that get called via antcall) and after the recompilation of ANT the build runs fine, even with CruiseControl. The build was running, after the restructre, smoothly, but when we run the build via CC we still got memory errors. After the recompilation of ANT now everything is fine.
Excellent, thanks for testing this.
I am trying at the moment to squash as many memory leakages as
possible before the release of Ant 1.7.0.

Peter

> Thanks to all :-)
>
> R,
>
> Markus
>
> -------- Original-Nachricht --------
> Datum: Thu, 19 Oct 2006 19:15:29 +0200
> Von: "Markus M. May" <mm...@gmx.net>
> An: Ant Users List <us...@ant.apache.org>
> Betreff: Re: antcall / depends
>
> > Thanks,
> >
> > I found the "memory leak" in our build structure and fixed some of this
> > already. I will also recompile ant and then I will restructe the rest of
> > the build process as soon as we get some time for this.
> > Thanks alot.
> >
> > R,
> >
> > Markus
> >
> > Am Donnerstag, den 19.10.2006, 16:51 +0100 schrieb Peter Reilly:
> > > On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > > > Hello,
> > > >
> > > > this is going to be nearly the same as restructuring the build
> > process, since we have more then one component, using these targets. I am
> > currently digging deeper into this, and hope, that I can restructure the build
> > tonight. This is going to get a long night :-(
> > >
> > > If you can recompile Ant, (1.6.5) there is a memory leakage associated
> > > with <antcall> and <taskdef> that can be fixed easily.
> > > In IntrospectionHelper.java, the method
> > >
> > >     public static synchronized IntrospectionHelper getHelper(Class c) {
> > >         IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c);
> > >         if (ih == null) {
> > >             ih = new IntrospectionHelper(c);
> > >             helpers.put(c, ih);
> > >         }
> > >         return ih;
> > >    }
> > > Change this to:
> > >
> > >     public static synchronized IntrospectionHelper getHelper(Class c) {
> > >         IntrospectionHelper ih = (IntrospectionHelper)
> > helpers.get(c.getName());
> > >         if (ih == null || c != ih.bean) {
> > >             ih = new IntrospectionHelper(c);
> > >             helpers.put(c.getName(), ih);
> > >         }
> > >         return ih;
> > >    }
> > >
> > > Recompile (./build.sh or build.bat in the source), copy
> > > $ant_source/dist/lib/ant.jar
> > > to $ANT_HOME/lib (*not* the other jar files as they need third party
> > jars
> > > to compile).
> > >
> > > This change is in the svn version of ant, but was done after
> > > the release of ant 1.7.0beta3.
> > >
> > > peter
> > >
> > >
> > > >
> > > >
> > > > -------- Original-Nachricht --------
> > > > Datum: Thu, 19 Oct 2006 16:04:06 +0100
> > > > Von: "Peter Reilly" <pe...@gmail.com>
> > > > An: "Ant Users List" <us...@ant.apache.org>
> > > > Betreff: Re: antcall / depends
> > > >
> > > > > On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > > > > > Hello,
> > > > > > I am currently facing a massive OutOfMemoryException problem. I
> > know
> > > > > that this is, because we are using ANTCALL quite heavily.
> > > > > > We have e.g. the following structure:
> > > > > >
> > > > > > TargetA
> > > > > >   depends on init (via depend)
> > > > > >   calls TargetB and TargetC (via antcall)
> > > > > > TargetB
> > > > > >   depends on init (via depend)
> > > > > > TargetC
> > > > > >   depends on init (via depend)
> > > > > >
> > > > > > Therefor for each antcall we call the target init. Since there are
> > > > > taskdefs in the init-target, there is quite some memory leak. Is
> > there some way,
> > > > > to not call the depends, once they are called, another time?
> > > > >
> > > > > Make the target "init" have an unless attribute:
> > > > >
> > > > > <target name="init" unless="initialized">
> > > > > </target>
> > > > >
> > > > > <target name="A" depends="init">
> > > > >     <antcall target="B">
> > > > >          <param name="initialized" value="true"/>
> > > > >     </antcall>
> > > > >     <antcall target="C">
> > > > >          <param name="initialized" value="true"/>
> > > > >     </antcall>
> > > > > </target>
> > > > >
> > > > >
> > > > > Or, if antcall is called with inheritAll="true" (the default)
> > > > >
> > > > > <target name="init" unless="initialized">
> > > > >   ...
> > > > >   <property name="initialized" value="yes, I am"/>
> > > > > </target>
> > > > >
> > > > > <target name="A" depends="init">
> > > > >     <antcall target="B"/>
> > > > >     <antcall target="C"/>
> > > > > </target>
> > > > >
> > > > > <target name="B" depends="init">
> > > > > </target>
> > > > > <target name="C" depends="init">
> > > > > </target>
> > > > >
> > > > > Peter
> > > > >
> > > > >
> > > > > > I know, that we should restructure our build, but currently we are
> > > > > facing a timely issue, so this is not an option anyway :-(
> > > > > >
> > > > > > Any help is appreciated.
> > > > > >
> > > > > > R,
> > > > > >
> > > > > > Markus M. May
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > 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
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>

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


Re: antcall / depends

Posted by "Markus M. May" <mm...@gmx.net>.
So, after I did some restructuring (we throw out some depend-attributes on targets that get called via antcall) and after the recompilation of ANT the build runs fine, even with CruiseControl. The build was running, after the restructre, smoothly, but when we run the build via CC we still got memory errors. After the recompilation of ANT now everything is fine.
Thanks to all :-)

R,

Markus

-------- Original-Nachricht --------
Datum: Thu, 19 Oct 2006 19:15:29 +0200
Von: "Markus M. May" <mm...@gmx.net>
An: Ant Users List <us...@ant.apache.org>
Betreff: Re: antcall / depends

> Thanks,
> 
> I found the "memory leak" in our build structure and fixed some of this
> already. I will also recompile ant and then I will restructe the rest of
> the build process as soon as we get some time for this.
> Thanks alot.
> 
> R,
> 
> Markus
> 
> Am Donnerstag, den 19.10.2006, 16:51 +0100 schrieb Peter Reilly:
> > On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > > Hello,
> > >
> > > this is going to be nearly the same as restructuring the build
> process, since we have more then one component, using these targets. I am
> currently digging deeper into this, and hope, that I can restructure the build
> tonight. This is going to get a long night :-(
> > 
> > If you can recompile Ant, (1.6.5) there is a memory leakage associated
> > with <antcall> and <taskdef> that can be fixed easily.
> > In IntrospectionHelper.java, the method
> > 
> >     public static synchronized IntrospectionHelper getHelper(Class c) {
> >         IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c);
> >         if (ih == null) {
> >             ih = new IntrospectionHelper(c);
> >             helpers.put(c, ih);
> >         }
> >         return ih;
> >    }
> > Change this to:
> > 
> >     public static synchronized IntrospectionHelper getHelper(Class c) {
> >         IntrospectionHelper ih = (IntrospectionHelper)
> helpers.get(c.getName());
> >         if (ih == null || c != ih.bean) {
> >             ih = new IntrospectionHelper(c);
> >             helpers.put(c.getName(), ih);
> >         }
> >         return ih;
> >    }
> > 
> > Recompile (./build.sh or build.bat in the source), copy
> > $ant_source/dist/lib/ant.jar
> > to $ANT_HOME/lib (*not* the other jar files as they need third party
> jars
> > to compile).
> > 
> > This change is in the svn version of ant, but was done after
> > the release of ant 1.7.0beta3.
> > 
> > peter
> > 
> > 
> > >
> > >
> > > -------- Original-Nachricht --------
> > > Datum: Thu, 19 Oct 2006 16:04:06 +0100
> > > Von: "Peter Reilly" <pe...@gmail.com>
> > > An: "Ant Users List" <us...@ant.apache.org>
> > > Betreff: Re: antcall / depends
> > >
> > > > On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > > > > Hello,
> > > > > I am currently facing a massive OutOfMemoryException problem. I
> know
> > > > that this is, because we are using ANTCALL quite heavily.
> > > > > We have e.g. the following structure:
> > > > >
> > > > > TargetA
> > > > >   depends on init (via depend)
> > > > >   calls TargetB and TargetC (via antcall)
> > > > > TargetB
> > > > >   depends on init (via depend)
> > > > > TargetC
> > > > >   depends on init (via depend)
> > > > >
> > > > > Therefor for each antcall we call the target init. Since there are
> > > > taskdefs in the init-target, there is quite some memory leak. Is
> there some way,
> > > > to not call the depends, once they are called, another time?
> > > >
> > > > Make the target "init" have an unless attribute:
> > > >
> > > > <target name="init" unless="initialized">
> > > > </target>
> > > >
> > > > <target name="A" depends="init">
> > > >     <antcall target="B">
> > > >          <param name="initialized" value="true"/>
> > > >     </antcall>
> > > >     <antcall target="C">
> > > >          <param name="initialized" value="true"/>
> > > >     </antcall>
> > > > </target>
> > > >
> > > >
> > > > Or, if antcall is called with inheritAll="true" (the default)
> > > >
> > > > <target name="init" unless="initialized">
> > > >   ...
> > > >   <property name="initialized" value="yes, I am"/>
> > > > </target>
> > > >
> > > > <target name="A" depends="init">
> > > >     <antcall target="B"/>
> > > >     <antcall target="C"/>
> > > > </target>
> > > >
> > > > <target name="B" depends="init">
> > > > </target>
> > > > <target name="C" depends="init">
> > > > </target>
> > > >
> > > > Peter
> > > >
> > > >
> > > > > I know, that we should restructure our build, but currently we are
> > > > facing a timely issue, so this is not an option anyway :-(
> > > > >
> > > > > Any help is appreciated.
> > > > >
> > > > > R,
> > > > >
> > > > > Markus M. May
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > 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
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: antcall / depends

Posted by "Markus M. May" <mm...@gmx.net>.
Thanks,

I found the "memory leak" in our build structure and fixed some of this
already. I will also recompile ant and then I will restructe the rest of
the build process as soon as we get some time for this.
Thanks alot.

R,

Markus

Am Donnerstag, den 19.10.2006, 16:51 +0100 schrieb Peter Reilly:
> On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > Hello,
> >
> > this is going to be nearly the same as restructuring the build process, since we have more then one component, using these targets. I am currently digging deeper into this, and hope, that I can restructure the build tonight. This is going to get a long night :-(
> 
> If you can recompile Ant, (1.6.5) there is a memory leakage associated
> with <antcall> and <taskdef> that can be fixed easily.
> In IntrospectionHelper.java, the method
> 
>     public static synchronized IntrospectionHelper getHelper(Class c) {
>         IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c);
>         if (ih == null) {
>             ih = new IntrospectionHelper(c);
>             helpers.put(c, ih);
>         }
>         return ih;
>    }
> Change this to:
> 
>     public static synchronized IntrospectionHelper getHelper(Class c) {
>         IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c.getName());
>         if (ih == null || c != ih.bean) {
>             ih = new IntrospectionHelper(c);
>             helpers.put(c.getName(), ih);
>         }
>         return ih;
>    }
> 
> Recompile (./build.sh or build.bat in the source), copy
> $ant_source/dist/lib/ant.jar
> to $ANT_HOME/lib (*not* the other jar files as they need third party jars
> to compile).
> 
> This change is in the svn version of ant, but was done after
> the release of ant 1.7.0beta3.
> 
> peter
> 
> 
> >
> >
> > -------- Original-Nachricht --------
> > Datum: Thu, 19 Oct 2006 16:04:06 +0100
> > Von: "Peter Reilly" <pe...@gmail.com>
> > An: "Ant Users List" <us...@ant.apache.org>
> > Betreff: Re: antcall / depends
> >
> > > On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > > > Hello,
> > > > I am currently facing a massive OutOfMemoryException problem. I know
> > > that this is, because we are using ANTCALL quite heavily.
> > > > We have e.g. the following structure:
> > > >
> > > > TargetA
> > > >   depends on init (via depend)
> > > >   calls TargetB and TargetC (via antcall)
> > > > TargetB
> > > >   depends on init (via depend)
> > > > TargetC
> > > >   depends on init (via depend)
> > > >
> > > > Therefor for each antcall we call the target init. Since there are
> > > taskdefs in the init-target, there is quite some memory leak. Is there some way,
> > > to not call the depends, once they are called, another time?
> > >
> > > Make the target "init" have an unless attribute:
> > >
> > > <target name="init" unless="initialized">
> > > </target>
> > >
> > > <target name="A" depends="init">
> > >     <antcall target="B">
> > >          <param name="initialized" value="true"/>
> > >     </antcall>
> > >     <antcall target="C">
> > >          <param name="initialized" value="true"/>
> > >     </antcall>
> > > </target>
> > >
> > >
> > > Or, if antcall is called with inheritAll="true" (the default)
> > >
> > > <target name="init" unless="initialized">
> > >   ...
> > >   <property name="initialized" value="yes, I am"/>
> > > </target>
> > >
> > > <target name="A" depends="init">
> > >     <antcall target="B"/>
> > >     <antcall target="C"/>
> > > </target>
> > >
> > > <target name="B" depends="init">
> > > </target>
> > > <target name="C" depends="init">
> > > </target>
> > >
> > > Peter
> > >
> > >
> > > > I know, that we should restructure our build, but currently we are
> > > facing a timely issue, so this is not an option anyway :-(
> > > >
> > > > Any help is appreciated.
> > > >
> > > > R,
> > > >
> > > > Markus M. May
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> >
> > ---------------------------------------------------------------------
> > 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
> 


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


Re: antcall / depends

Posted by Peter Reilly <pe...@gmail.com>.
On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> Hello,
>
> this is going to be nearly the same as restructuring the build process, since we have more then one component, using these targets. I am currently digging deeper into this, and hope, that I can restructure the build tonight. This is going to get a long night :-(

If you can recompile Ant, (1.6.5) there is a memory leakage associated
with <antcall> and <taskdef> that can be fixed easily.
In IntrospectionHelper.java, the method

    public static synchronized IntrospectionHelper getHelper(Class c) {
        IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c);
        if (ih == null) {
            ih = new IntrospectionHelper(c);
            helpers.put(c, ih);
        }
        return ih;
   }
Change this to:

    public static synchronized IntrospectionHelper getHelper(Class c) {
        IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c.getName());
        if (ih == null || c != ih.bean) {
            ih = new IntrospectionHelper(c);
            helpers.put(c.getName(), ih);
        }
        return ih;
   }

Recompile (./build.sh or build.bat in the source), copy
$ant_source/dist/lib/ant.jar
to $ANT_HOME/lib (*not* the other jar files as they need third party jars
to compile).

This change is in the svn version of ant, but was done after
the release of ant 1.7.0beta3.

peter


>
>
> -------- Original-Nachricht --------
> Datum: Thu, 19 Oct 2006 16:04:06 +0100
> Von: "Peter Reilly" <pe...@gmail.com>
> An: "Ant Users List" <us...@ant.apache.org>
> Betreff: Re: antcall / depends
>
> > On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > > Hello,
> > > I am currently facing a massive OutOfMemoryException problem. I know
> > that this is, because we are using ANTCALL quite heavily.
> > > We have e.g. the following structure:
> > >
> > > TargetA
> > >   depends on init (via depend)
> > >   calls TargetB and TargetC (via antcall)
> > > TargetB
> > >   depends on init (via depend)
> > > TargetC
> > >   depends on init (via depend)
> > >
> > > Therefor for each antcall we call the target init. Since there are
> > taskdefs in the init-target, there is quite some memory leak. Is there some way,
> > to not call the depends, once they are called, another time?
> >
> > Make the target "init" have an unless attribute:
> >
> > <target name="init" unless="initialized">
> > </target>
> >
> > <target name="A" depends="init">
> >     <antcall target="B">
> >          <param name="initialized" value="true"/>
> >     </antcall>
> >     <antcall target="C">
> >          <param name="initialized" value="true"/>
> >     </antcall>
> > </target>
> >
> >
> > Or, if antcall is called with inheritAll="true" (the default)
> >
> > <target name="init" unless="initialized">
> >   ...
> >   <property name="initialized" value="yes, I am"/>
> > </target>
> >
> > <target name="A" depends="init">
> >     <antcall target="B"/>
> >     <antcall target="C"/>
> > </target>
> >
> > <target name="B" depends="init">
> > </target>
> > <target name="C" depends="init">
> > </target>
> >
> > Peter
> >
> >
> > > I know, that we should restructure our build, but currently we are
> > facing a timely issue, so this is not an option anyway :-(
> > >
> > > Any help is appreciated.
> > >
> > > R,
> > >
> > > Markus M. May
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
> ---------------------------------------------------------------------
> 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


Re: antcall / depends

Posted by "Markus M. May" <mm...@gmx.net>.
Hello,

this is going to be nearly the same as restructuring the build process, since we have more then one component, using these targets. I am currently digging deeper into this, and hope, that I can restructure the build tonight. This is going to get a long night :-(


-------- Original-Nachricht --------
Datum: Thu, 19 Oct 2006 16:04:06 +0100
Von: "Peter Reilly" <pe...@gmail.com>
An: "Ant Users List" <us...@ant.apache.org>
Betreff: Re: antcall / depends

> On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> > Hello,
> > I am currently facing a massive OutOfMemoryException problem. I know
> that this is, because we are using ANTCALL quite heavily.
> > We have e.g. the following structure:
> >
> > TargetA
> >   depends on init (via depend)
> >   calls TargetB and TargetC (via antcall)
> > TargetB
> >   depends on init (via depend)
> > TargetC
> >   depends on init (via depend)
> >
> > Therefor for each antcall we call the target init. Since there are
> taskdefs in the init-target, there is quite some memory leak. Is there some way,
> to not call the depends, once they are called, another time?
> 
> Make the target "init" have an unless attribute:
> 
> <target name="init" unless="initialized">
> </target>
> 
> <target name="A" depends="init">
>     <antcall target="B">
>          <param name="initialized" value="true"/>
>     </antcall>
>     <antcall target="C">
>          <param name="initialized" value="true"/>
>     </antcall>
> </target>
> 
> 
> Or, if antcall is called with inheritAll="true" (the default)
> 
> <target name="init" unless="initialized">
>   ...
>   <property name="initialized" value="yes, I am"/>
> </target>
> 
> <target name="A" depends="init">
>     <antcall target="B"/>
>     <antcall target="C"/>
> </target>
> 
> <target name="B" depends="init">
> </target>
> <target name="C" depends="init">
> </target>
> 
> Peter
> 
> 
> > I know, that we should restructure our build, but currently we are
> facing a timely issue, so this is not an option anyway :-(
> >
> > Any help is appreciated.
> >
> > R,
> >
> > Markus M. May
> >
> > ---------------------------------------------------------------------
> > 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

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


Re: antcall / depends

Posted by Peter Reilly <pe...@gmail.com>.
On 10/19/06, Markus M. May <mm...@gmx.net> wrote:
> Hello,
> I am currently facing a massive OutOfMemoryException problem. I know that this is, because we are using ANTCALL quite heavily.
> We have e.g. the following structure:
>
> TargetA
>   depends on init (via depend)
>   calls TargetB and TargetC (via antcall)
> TargetB
>   depends on init (via depend)
> TargetC
>   depends on init (via depend)
>
> Therefor for each antcall we call the target init. Since there are taskdefs in the init-target, there is quite some memory leak. Is there some way, to not call the depends, once they are called, another time?

Make the target "init" have an unless attribute:

<target name="init" unless="initialized">
</target>

<target name="A" depends="init">
    <antcall target="B">
         <param name="initialized" value="true"/>
    </antcall>
    <antcall target="C">
         <param name="initialized" value="true"/>
    </antcall>
</target>


Or, if antcall is called with inheritAll="true" (the default)

<target name="init" unless="initialized">
  ...
  <property name="initialized" value="yes, I am"/>
</target>

<target name="A" depends="init">
    <antcall target="B"/>
    <antcall target="C"/>
</target>

<target name="B" depends="init">
</target>
<target name="C" depends="init">
</target>

Peter


> I know, that we should restructure our build, but currently we are facing a timely issue, so this is not an option anyway :-(
>
> Any help is appreciated.
>
> R,
>
> Markus M. May
>
> ---------------------------------------------------------------------
> 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