ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Haas <thomas.h...@softwired-inc.com>
Subject Re: [PATCH]: Added maxmemory option to javadoc task
Date Wed, 22 Mar 2000 21:19:13 GMT
Hi

Nice feature.
How about putting it into the Java task and let Javadoc extend Java (with fork=true by
default), so the feature would be available to other java tasks, which run in VM on their
own
(like the JUnit task I submitted and my metamata task, which will be sent to this list soon,
and others we are about to create).


- tom


Jay Handfield wrote:

> Hello,
>
> When building the javadocs for my project, I kept getting
> out of memory exceptions.  The ideal solution to this problem
> would be to have javadoc run in process and set the max memory
> higher via the JAVACMD variable, but I understand that this is not
> possible because the sun class calls System.exit().  As an
> alternative I have come up with a patch to the javadoc task that
> will allow you to set the maximum memory of the javadoc JVM.  For
> example,
>
> <javadoc srcdir="myproj" maxmemory="64m"/>
>
> will add a -J-Xmx64m to the javadoc command line (under java2).
>
> Does this seem like a reasonable solution?  I would be happy to
> supply a patch for the documentation also, if this patch gets applied.
>
> Thanks,
> Jay Handfield
>
>   ------------------------------------------------------------------------
> Index: Javadoc.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
> retrieving revision 1.7
> diff -u -r1.7 Javadoc.java
> --- Javadoc.java        2000/03/03 14:15:42     1.7
> +++ Javadoc.java        2000/03/21 23:39:53
> @@ -79,6 +79,7 @@
>
>  public class Javadoc extends Exec {
>
> +    private String maxmemory = null;
>      private String sourcePath = null;
>      private File destDir = null;
>      private File overviewFile = null;
> @@ -120,6 +121,10 @@
>      private String docencoding = null;
>      private Vector compileList = new Vector(10);
>
> +    public void setMaxmemory(String src){
> +        maxmemory = src;
> +    }
> +
>      public void setSourcepath(String src) {
>          sourcePath = project.translatePath(src);
>      }
> @@ -250,6 +255,15 @@
>  // ------------------------------------------------ general javadoc arguments
>          if (classpath == null)
>              classpath = System.getProperty("java.class.path");
> +
> +        if(maxmemory != null){
> +            if(javadoc1){
> +                argList.addElement("-J-mx" + maxmemory);
> +            }
> +            else{
> +                argList.addElement("-J-Xmx" + maxmemory);
> +            }
> +        }
>
>          if ( (!javadoc1) || (sourcePath == null) ) {
>              argList.addElement("-classpath");


Mime
View raw message