views:

26

answers:

1

I'm trying to run javadoc on a multi-module Maven project and I keep getting OutOfMemory Error no matter how high I set the heap. I've even tried upping the pergen space. Is there a way to find the root cause? I suspect some sort of recursive reference in a Javadoc comment but the project is so huge it'll take days/weeks/months to sift thru.

+1  A: 

don't set -Xms and -Xmx (they will increase the memory of the maven process), use the minmemory and maxmemory options of the maven javadoc plugin to increase the memory of the forked javadoc process

   <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
        <configuration>
             <minmemory>128m</minmemory>
             <maxmemory>1024m</maxmemory>
             ...
        </configuration>
      </plugin>
    </plugins>
    ...
  </reporting>
seanizer
That almost looks like it wants to work. I don't know why but the process gets stuck when I set the heap in MAVEN_OPTS to 2048. (Ctrl+C won't even terminate and I must send signal 9 from another terminal.) I just backed it down and also tried your parameter and now it completes. I still have another project that throws OOM. I'm setting via the cmd line using -D. I gotta try inlining in my pom as I believe this other project uses a dated version of the Javadoc plugin.
Cliff
Nope, I just tried this from the cmd line and it STILL throws the OOM:mvn -Dmaxmemory=1024m org.apache.maven.plugins:maven-javadoc-plugin:2.6:javadoc
Cliff