ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: subant and memory problems
Date Thu, 01 Jun 2006 06:41:59 GMT
>Probably not. Ideally there would be a fork attribute for <ant> (and
><subant>) to ensure each sub-build runs in its own VM, 
>ensuring proper release of memory (when the process exists), 
>but it's never been done and is non-trivial, since a 
>cross-process logger/listener thing needs to be put in place, 
>and what to do with references? Serialize them to the 
>sub-project? Not much is serializable in Ant.
>To solve your problem, you may have to switch to <apply>, 
>which forks a new Ant JVM for each sub-build (in non-parallel 
>mode), which would emulate fork=true for <ant>. --DD

Long time ago I wrote a macro for starting Ant from a buildfile

    <macrodef name="startAnt">
        <attribute name="args" default=""/>
            <java classname=""
taskname="startAnt" errorproperty="nul">
                <arg line="@{args}"/>
                    <!-- All what it need, without quitting the JVM -->
                    <revoke class="java.lang.RuntimePermission"
                    <grant  class="java.lang.RuntimePermission"
                    <grant  class="java.lang.reflect.ReflectPermission"
                    <grant  class="java.util.PropertyPermission"
name="*" actions="read,write"/>
                    <grant  class=""
name="&lt;&lt;ALL FILES&gt;&gt;" actions="read,write,delete,execute"/>

You could start with that implementing your <apply> (dont forget to
allow JVM-quittig) ;-)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message