You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thorsten Heit <th...@xtramind.com> on 2006/02/23 19:11:53 UTC

OutOfMemoryError when creating Javadoc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

when I want to create the Javadoc for my project, Maven fails with an
OutOfMemoryError. According to the documentation the javadoc plugin
supports a parameter "maxmemory" so I added the following flag to the
plugin configuration:


  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <maxmemory>256m</maxmemory>
        </configuration>
      </plugin>
    </plugins>


Unfortunately I'm getting the following error when executing "mvn
javadoc:javadoc":



[INFO] [javadoc:javadoc]
[INFO] c:\Programme\Java\jdk1.5.0\jre\..\bin\javadoc.exe @options @files
usage: javadoc [options] [packagenames] [sourcefiles] [@files]
- -overview <file>          Read overview documentation from HTML file

(...rest of the javadoc's command line parameters/options omitted...)

- -stylesheetfile <path>            File to change style of the generated
documentation
- -docencoding <name>               Output encoding name
1 error
[INFO]
-
----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
-
----------------------------------------------------------------------------
[INFO] An error has occurred in JavaDocs report generation.

Embedded error: Exit code: 1 - javadoc: error - invalid flag: -J-Xmx256m

[INFO]
-
----------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
-
----------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Feb 23 18:20:06 CET 2006
[INFO] Final Memory: 3M/7M
[INFO]
-
----------------------------------------------------------------------------


Can someone tell me what I'm doing wrong?


Regards

Thorsten

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (MingW32)

iD8DBQFD/frpQvObkgCcDe0RAlF1AJ0b9Aj7bMJz2iQi/a0cDPG1TMIhcQCcCHRO
eGCol2cWbY6EHmrgcPVlFKc=
=sD3W
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: OutOfMemoryError when creating Javadoc

Posted by Thorsten Heit <th...@xtramind.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Where you running maven within an IDE such as MyEclipse? Today i attemped it
> inside MyEclipse and always received an OutOfMemoryError. Ran it within
> command prompt and had no problems.

No, I started Maven from the command line. According to Process Explorer
the javadoc tool is started via

CMD.EXE /X /C c:\Programme\Java\jdk1.5.0\jre\..\bin\javadoc.exe @options
@files

I just paused the javadoc process and had a look into the two files
"files" and "options". It seems Maven doesn't add the contents of
MAVEN_OPTS into the "options" file; I don't see the "-Xmx256m" flag...

Is this a bug or a feature?


Regards

Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (MingW32)

iD8DBQFD/0EzQvObkgCcDe0RAjRLAKCC6LWPQH8MGQ96Tb4PimuyrbNKzACgvBKj
Tz+chH8jWTq3WE0weyowUhU=
=XTR4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: OutOfMemoryError when creating Javadoc

Posted by Matt Campbell <ma...@gmail.com>.
Where you running maven within an IDE such as MyEclipse? Today i attemped it
inside MyEclipse and always received an OutOfMemoryError. Ran it within
command prompt and had no problems.

On 2/24/06, Yann Le Du <le...@gmail.com> wrote:
>
> OK, so the problem is not about 256 Mo then. Still the memory grows and
> never goes over some value (90 Mo for you). I think it's worth a JIRA
> issue,
> can you create one ?
>
> To solve your problem, you can try and fork the compile and test tasks,
> maybe you'll gain enough memory so that javadoc do not fail :
> ~         <plugin>
> ~           <artifactId>maven-compiler-plugin</artifactId>
> ~           <configuration>
> ~             <fork>true</fork>
> ~           </configuration>
> ~         </plugin>
> ~         <plugin>
> ~           <artifactId>maven-surefire-plugin</artifactId>
> ~           <configuration>
> ~             <forkMode>once</forkMode>
> ~           </configuration>
> ~         </plugin>
>
> 2006/2/24, Thorsten Heit <th...@xtramind.com>:
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > > I'm not even sure MAVEN_OPTS=-Xmx is efficient over 256 Mo. I tried
> > several
> > > values and always the mvn task grew to about 256 Mo then stopped. Can
> > you
> > > try again and watch in the task manager how the used memory evolves ?
> >
> > I watched Maven's memory consumption with Sysinternals Process Explorer,
> > but the whole process never comsumed more than 90MB, independent of
> > whether I used -Xmx384m or -Xmx256m in MAVEN_OPTS. In both cases the
> > OOME occurs after quite a lot of time...
> >
> >
> > Thorsten
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.2.1 (MingW32)
> >
> > iD8DBQFD/zXxQvObkgCcDe0RAlZfAJ44iJTdCPoTCi7k6tbJLmfPHrcBUwCgyv3H
> > Vt+dEm3suYW8aIbIpRna6pA=
> > =C5wA
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>

Re: OutOfMemoryError when creating Javadoc

Posted by Yann Le Du <le...@gmail.com>.
OK, so the problem is not about 256 Mo then. Still the memory grows and
never goes over some value (90 Mo for you). I think it's worth a JIRA issue,
can you create one ?

To solve your problem, you can try and fork the compile and test tasks,
maybe you'll gain enough memory so that javadoc do not fail :
~         <plugin>
~           <artifactId>maven-compiler-plugin</artifactId>
~           <configuration>
~             <fork>true</fork>
~           </configuration>
~         </plugin>
~         <plugin>
~           <artifactId>maven-surefire-plugin</artifactId>
~           <configuration>
~             <forkMode>once</forkMode>
~           </configuration>
~         </plugin>

2006/2/24, Thorsten Heit <th...@xtramind.com>:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> > I'm not even sure MAVEN_OPTS=-Xmx is efficient over 256 Mo. I tried
> several
> > values and always the mvn task grew to about 256 Mo then stopped. Can
> you
> > try again and watch in the task manager how the used memory evolves ?
>
> I watched Maven's memory consumption with Sysinternals Process Explorer,
> but the whole process never comsumed more than 90MB, independent of
> whether I used -Xmx384m or -Xmx256m in MAVEN_OPTS. In both cases the
> OOME occurs after quite a lot of time...
>
>
> Thorsten
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.1 (MingW32)
>
> iD8DBQFD/zXxQvObkgCcDe0RAlZfAJ44iJTdCPoTCi7k6tbJLmfPHrcBUwCgyv3H
> Vt+dEm3suYW8aIbIpRna6pA=
> =C5wA
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: OutOfMemoryError when creating Javadoc

Posted by Thorsten Heit <th...@xtramind.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I'm not even sure MAVEN_OPTS=-Xmx is efficient over 256 Mo. I tried several
> values and always the mvn task grew to about 256 Mo then stopped. Can you
> try again and watch in the task manager how the used memory evolves ?

I watched Maven's memory consumption with Sysinternals Process Explorer,
but the whole process never comsumed more than 90MB, independent of
whether I used -Xmx384m or -Xmx256m in MAVEN_OPTS. In both cases the
OOME occurs after quite a lot of time...


Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (MingW32)

iD8DBQFD/zXxQvObkgCcDe0RAlZfAJ44iJTdCPoTCi7k6tbJLmfPHrcBUwCgyv3H
Vt+dEm3suYW8aIbIpRna6pA=
=C5wA
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: OutOfMemoryError when creating Javadoc

Posted by Yann Le Du <le...@gmail.com>.
I'm not even sure MAVEN_OPTS=-Xmx is efficient over 256 Mo. I tried several
values and always the mvn task grew to about 256 Mo then stopped. Can you
try again and watch in the task manager how the used memory evolves ?

- Yann

2006/2/24, Thorsten Heit <th...@xtramind.com>:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> > set MAVEN_OPTS=xyz instead, no need to modify the batch file
>
> I tried "MAVEN_OPTS=-Xmx384m" yesterday evening. Now the Javadoc task
> starts, but after about 10-15min the OOME occurs again...
>
> Although I don't know why Javadoc takes that much time, even on a
> reasonably fast machine (2.8GHz P-IV with Hyperthreading). One class
> (~1200 lines) took >5min to complete...
>
>
>
> Regards
>
> Thorsten
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.1 (MingW32)
>
> iD8DBQFD/uAUQvObkgCcDe0RAo6VAKC2Udh+mYVz3jmxdX2GvaxEyft85wCgkZmC
> 4ZXqVzEhba2rH7bibQPhdUo=
> =doqg
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: OutOfMemoryError when creating Javadoc

Posted by Thorsten Heit <th...@xtramind.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

> set MAVEN_OPTS=xyz instead, no need to modify the batch file

I tried "MAVEN_OPTS=-Xmx384m" yesterday evening. Now the Javadoc task
starts, but after about 10-15min the OOME occurs again...

Although I don't know why Javadoc takes that much time, even on a
reasonably fast machine (2.8GHz P-IV with Hyperthreading). One class
(~1200 lines) took >5min to complete...



Regards

Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (MingW32)

iD8DBQFD/uAUQvObkgCcDe0RAo6VAKC2Udh+mYVz3jmxdX2GvaxEyft85wCgkZmC
4ZXqVzEhba2rH7bibQPhdUo=
=doqg
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: OutOfMemoryError when creating Javadoc

Posted by dan tran <da...@gmail.com>.
set MAVEN_OPTS=xyz instead, no need to modify the batch file

On 2/23/06, Manoj Kumar <ja...@gmail.com> wrote:
>
> hi
>
> i never use javadoc, so i can't say about your error but you can solve
> your
> out of memory problem by increasing memory heap size in mvn.bat file, that
> is in your maven installations bin dir.
> in mvn.bat you can find the following
>
>
> @REM Start MAVEN2
> for %%i in ("%M2_HOME%"\core\boot\classworlds-*) do set
> CLASSWORLDS_JAR="%%i"
> %MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-
> Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%"
> org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
> goto end
>
> just add the -Xmx256m after %MAVEN_OPTS% it will  become as
>
> @REM Start MAVEN2
> for %%i in ("%M2_HOME%"\core\boot\classworlds-*) do set
> CLASSWORLDS_JAR="%%i"
> %MAVEN_JAVA_EXE% %MAVEN_OPTS% -Xmx256m -classpath %CLASSWORLDS_JAR% "-
> Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%"
> org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
> goto end
>
> hope it will work
>
>
> On 2/23/06, Thorsten Heit <th...@xtramind.com> wrote:
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi,
> >
> > when I want to create the Javadoc for my project, Maven fails with an
> > OutOfMemoryError. According to the documentation the javadoc plugin
> > supports a parameter "maxmemory" so I added the following flag to the
> > plugin configuration:
> >
> >
> >   <build>
> >     <plugins>
> >       <plugin>
> >         <groupId>org.apache.maven.plugins</groupId>
> >         <artifactId>maven-javadoc-plugin</artifactId>
> >         <configuration>
> >           <maxmemory>256m</maxmemory>
> >         </configuration>
> >       </plugin>
> >     </plugins>
> >
> >
> > Unfortunately I'm getting the following error when executing "mvn
> > javadoc:javadoc":
> >
> >
> >
> > [INFO] [javadoc:javadoc]
> > [INFO] c:\Programme\Java\jdk1.5.0\jre\..\bin\javadoc.exe @options @files
> > usage: javadoc [options] [packagenames] [sourcefiles] [@files]
> > - -overview <file>          Read overview documentation from HTML file
> >
> > (...rest of the javadoc's command line parameters/options omitted...)
> >
> > - -stylesheetfile <path>            File to change style of the
> generated
> > documentation
> > - -docencoding <name>               Output encoding name
> > 1 error
> > [INFO]
> > -
> >
> >
> ----------------------------------------------------------------------------
> > [ERROR] BUILD ERROR
> > [INFO]
> > -
> >
> >
> ----------------------------------------------------------------------------
> > [INFO] An error has occurred in JavaDocs report generation.
> >
> > Embedded error: Exit code: 1 - javadoc: error - invalid flag: -J-Xmx256m
> >
> > [INFO]
> > -
> >
> >
> ----------------------------------------------------------------------------
> > [INFO] For more information, run Maven with the -e switch
> > [INFO]
> > -
> >
> >
> ----------------------------------------------------------------------------
> > [INFO] Total time: 3 seconds
> > [INFO] Finished at: Thu Feb 23 18:20:06 CET 2006
> > [INFO] Final Memory: 3M/7M
> > [INFO]
> > -
> >
> >
> ----------------------------------------------------------------------------
> >
> >
> > Can someone tell me what I'm doing wrong?
> >
> >
> > Regards
> >
> > Thorsten
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.2.1 (MingW32)
> >
> > iD8DBQFD/frpQvObkgCcDe0RAlF1AJ0b9Aj7bMJz2iQi/a0cDPG1TMIhcQCcCHRO
> > eGCol2cWbY6EHmrgcPVlFKc=
> > =sD3W
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>

Re: OutOfMemoryError when creating Javadoc

Posted by Manoj Kumar <ja...@gmail.com>.
hi

i never use javadoc, so i can't say about your error but you can solve your
out of memory problem by increasing memory heap size in mvn.bat file, that
is in your maven installations bin dir.
in mvn.bat you can find the following


@REM Start MAVEN2
for %%i in ("%M2_HOME%"\core\boot\classworlds-*) do set
CLASSWORLDS_JAR="%%i"
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-
Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%"
org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
goto end

just add the -Xmx256m after %MAVEN_OPTS% it will  become as

@REM Start MAVEN2
for %%i in ("%M2_HOME%"\core\boot\classworlds-*) do set
CLASSWORLDS_JAR="%%i"
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -Xmx256m -classpath %CLASSWORLDS_JAR% "-
Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%"
org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
goto end

hope it will work


On 2/23/06, Thorsten Heit <th...@xtramind.com> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> when I want to create the Javadoc for my project, Maven fails with an
> OutOfMemoryError. According to the documentation the javadoc plugin
> supports a parameter "maxmemory" so I added the following flag to the
> plugin configuration:
>
>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-javadoc-plugin</artifactId>
>         <configuration>
>           <maxmemory>256m</maxmemory>
>         </configuration>
>       </plugin>
>     </plugins>
>
>
> Unfortunately I'm getting the following error when executing "mvn
> javadoc:javadoc":
>
>
>
> [INFO] [javadoc:javadoc]
> [INFO] c:\Programme\Java\jdk1.5.0\jre\..\bin\javadoc.exe @options @files
> usage: javadoc [options] [packagenames] [sourcefiles] [@files]
> - -overview <file>          Read overview documentation from HTML file
>
> (...rest of the javadoc's command line parameters/options omitted...)
>
> - -stylesheetfile <path>            File to change style of the generated
> documentation
> - -docencoding <name>               Output encoding name
> 1 error
> [INFO]
> -
>
> ----------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> -
>
> ----------------------------------------------------------------------------
> [INFO] An error has occurred in JavaDocs report generation.
>
> Embedded error: Exit code: 1 - javadoc: error - invalid flag: -J-Xmx256m
>
> [INFO]
> -
>
> ----------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> -
>
> ----------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Thu Feb 23 18:20:06 CET 2006
> [INFO] Final Memory: 3M/7M
> [INFO]
> -
>
> ----------------------------------------------------------------------------
>
>
> Can someone tell me what I'm doing wrong?
>
>
> Regards
>
> Thorsten
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.1 (MingW32)
>
> iD8DBQFD/frpQvObkgCcDe0RAlF1AJ0b9Aj7bMJz2iQi/a0cDPG1TMIhcQCcCHRO
> eGCol2cWbY6EHmrgcPVlFKc=
> =sD3W
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: OutOfMemoryError when creating Javadoc

Posted by Dirk Olmes <di...@xanthippe.ping.de>.
> Hi,
>
> when I want to create the Javadoc for my project, Maven fails with an
> OutOfMemoryError. According to the documentation the javadoc plugin
> supports a parameter "maxmemory" so I added the following flag to the
> plugin configuration:
>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-javadoc-plugin</artifactId>
>         <configuration>
>           <maxmemory>256m</maxmemory>
>         </configuration>
>       </plugin>
>     </plugins>
>
> Unfortunately I'm getting the following error when executing "mvn
> javadoc:javadoc":
>
> [INFO] [javadoc:javadoc]
> [INFO] c:\Programme\Java\jdk1.5.0\jre\..\bin\javadoc.exe @options @files
> usage: javadoc [options] [packagenames] [sourcefiles] [@files]
> - -overview <file>          Read overview documentation from HTML file
>
> (...rest of the javadoc's command line parameters/options omitted...)
>
> - -stylesheetfile <path>            File to change style of the generated
> documentation
> - -docencoding <name>               Output encoding name
> 1 error

Ah, the joys of the javadoc plugin invocation!
The javadoc plugin invokes the javadoc tool in a separate task. In order
to do this, the plugin creates a temporary file that includes all the
options that are to be passed to the javadoc command and starts javadoc
with just this config file.

Of course, any options that apply to the javadoc invocation (that would be
passed to javadoc with the -J option) end up in the config file, too,
causing javadoc to complain.

I'm afraid that you have to go with the workarounds posted here
(increasing max heap for the mvn task).

-dirk

-- 
Anyway kids, have fun, play nicely, be good. And remember - if it ain't
broke, hit it again.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org