git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267861 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1672,6 +1672,13 @@ the one that is currently running Ant.</p> | |||||
disabled)</td> | disabled)</td> | ||||
<td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td valign="top">maxmemory</td> | |||||
<td valign="top">Max amount of memory to allocate to the forked VM | |||||
(ignored if fork is disabled)</td> | |||||
<td align="center" valign="top">all</td> | |||||
<td align="center" valign="top">No</td> | |||||
</tr> | |||||
<tr> | <tr> | ||||
<td valign="top">failonerror</td> | <td valign="top">failonerror</td> | ||||
<td valign="top">Stop the buildprocess if the command exits with a | <td valign="top">Stop the buildprocess if the command exits with a | ||||
@@ -200,6 +200,17 @@ public class Java extends Task { | |||||
this.dir = d; | this.dir = d; | ||||
} | } | ||||
/** | |||||
* -mx or -Xmx depending on VM version | |||||
*/ | |||||
public void setMaxmemory(String max){ | |||||
if (Project.getJavaVersion().startsWith("1.1")) { | |||||
createJvmarg().setValue("-mx"+max); | |||||
} else { | |||||
createJvmarg().setValue("-Xmx"+max); | |||||
} | |||||
} | |||||
/** | /** | ||||
* Executes the given classname with the given arguments as it | * Executes the given classname with the given arguments as it | ||||
* was a command line application. | * was a command line application. | ||||