diff --git a/docs/index.html b/docs/index.html index d44428ded..e7fb9b731 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1672,6 +1672,13 @@ the one that is currently running Ant.

disabled) No + + maxmemory + Max amount of memory to allocate to the forked VM + (ignored if fork is disabled) + all + No + failonerror Stop the buildprocess if the command exits with a diff --git a/src/main/org/apache/tools/ant/taskdefs/Java.java b/src/main/org/apache/tools/ant/taskdefs/Java.java index ff39060de..c842274e7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Java.java +++ b/src/main/org/apache/tools/ant/taskdefs/Java.java @@ -200,6 +200,17 @@ public class Java extends Task { 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 * was a command line application.