jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 1.x Javadoc Plugin
  • MPJAVADOC-3

java.lang.OutOfMemoryError when running maven

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: None
  • Fix Version/s: None
  • Labels:
    None

Description

When running maven plugins (specifically javadoc and junit), we're now getting OutOfMemoryErrors. This was not a problem earlier, presumably because the codebase was smaller.

Running these exact same tasks using a plain ant script does not cause any problems, so it must be something with maven.

  • Options
    • Show All
    • Show Open

Sub-Tasks

1.
change default mem settings Sub-task Closed Closed Unassigned
 

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
dion gillard added a comment - 24/Aug/03 9:21 PM

Set
MAVEN_OPTS=-Xmx512m

as an environment variable and re-run it.

Show
dion gillard added a comment - 24/Aug/03 9:21 PM Set MAVEN_OPTS=-Xmx512m as an environment variable and re-run it.
Hide
Permalink
Havard Bjastad added a comment - 20/Oct/03 6:40 AM

We're seeing the same problems - in a project with 1400 classes. In addition to the mentioned goals, we also see it when running linkcheck and simian reports.

Show
Havard Bjastad added a comment - 20/Oct/03 6:40 AM We're seeing the same problems - in a project with 1400 classes. In addition to the mentioned goals, we also see it when running linkcheck and simian reports.
Hide
Permalink
Joakim Erdfelt added a comment - 20/Oct/03 10:14 AM

We are seeing a host of OutOfMemoryErrors with many maven-reports, including javadoc and junit.

Example of our environment.
(host name and project name neutered, due to corporate concerns)
[erdfeltj@host-foo:project-foo]$ sloccount src src-test
SLOC Directory SLOC-by-Language (Sorted)
490497 src java=490497
75257 src-test java=75257

[erdfeltj@host-foo:project-foo]$ find src -name "*.java" | wc -l
1151
[erdfeltj@host-foo:project-foo]$ find src-test -name "*.java" | wc -l
430

[erdfeltj@host-foo:project-foo]$ echo $MAVEN_OPTS
-Xmx2048m

This is a large solaris box we are compiling on, with 28GB of RAM, and over 900GB of free disk space. So RAM and Disk Space is not a problem.

Yet, we cannot run maven against this modestly sized project with the following reports turned on.
All of these plugins will cause an OutOfMemoryError (or StackOverflowError) with 2GB of RAM allocated to the project.

  • maven-javadoc-plugin - 1.3
  • maven-junit-report-plugin - 1.3
  • maven-linkcheck-plugin - 1.1
  • maven-tasklist-plugin - 2.2

We also have a project of 4,166 classes (single WAR file) that can only be compiled, jar'd, and deployed.

I've been working on a plugin updates / patches / replacements for large projects. (Already have a patch into jcoverage for large sets of classes under windows.)

Show
Joakim Erdfelt added a comment - 20/Oct/03 10:14 AM We are seeing a host of OutOfMemoryErrors with many maven-reports, including javadoc and junit. Example of our environment. (host name and project name neutered, due to corporate concerns) [erdfeltj@host-foo:project-foo]$ sloccount src src-test SLOC Directory SLOC-by-Language (Sorted) 490497 src java=490497 75257 src-test java=75257 [erdfeltj@host-foo:project-foo]$ find src -name "*.java" | wc -l 1151 [erdfeltj@host-foo:project-foo]$ find src-test -name "*.java" | wc -l 430 [erdfeltj@host-foo:project-foo]$ echo $MAVEN_OPTS -Xmx2048m This is a large solaris box we are compiling on, with 28GB of RAM, and over 900GB of free disk space. So RAM and Disk Space is not a problem. Yet, we cannot run maven against this modestly sized project with the following reports turned on. All of these plugins will cause an OutOfMemoryError (or StackOverflowError) with 2GB of RAM allocated to the project.
  • maven-javadoc-plugin - 1.3
  • maven-junit-report-plugin - 1.3
  • maven-linkcheck-plugin - 1.1
  • maven-tasklist-plugin - 2.2
We also have a project of 4,166 classes (single WAR file) that can only be compiled, jar'd, and deployed. I've been working on a plugin updates / patches / replacements for large projects. (Already have a patch into jcoverage for large sets of classes under windows.)
Hide
Permalink
Joakim Erdfelt added a comment - 20/Oct/03 2:52 PM

One more thing to add to the above comment,
This occurs with maven-1.0-rc1 (released rc1, not cvs).
Under J2SDK 1.4.2_01 (on Solaris and Windows).

Show
Joakim Erdfelt added a comment - 20/Oct/03 2:52 PM One more thing to add to the above comment, This occurs with maven-1.0-rc1 (released rc1, not cvs). Under J2SDK 1.4.2_01 (on Solaris and Windows).
Hide
Permalink
dion gillard added a comment - 20/Oct/03 11:29 PM

Does forking junit or javadoc help? There are properties for this.

Show
dion gillard added a comment - 20/Oct/03 11:29 PM Does forking junit or javadoc help? There are properties for this.
Hide
Permalink
dion gillard added a comment - 20/Oct/03 11:30 PM

Also, an example of the ant script that 'works' would be helpful.

Show
dion gillard added a comment - 20/Oct/03 11:30 PM Also, an example of the ant script that 'works' would be helpful.
Hide
Permalink
Joakim Erdfelt added a comment - 21/Oct/03 10:45 AM

I cannot include older ant script (due to corporate security policy), besides, after neutering it would be useless to you, (I think).

Ok, some success with javadoc and junit, but the tasklist and linkcheck are still issues.

junit:
setting the folling in the project.properties helps with junit.
maven.junit.jvmargs = -Xmx1024m
maven.junit.fork = true

javadoc:
Since according to the ant manual at http://ant.apache.org/manual/CoreTasks/javadoc.html, it states ...

"NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the same VM as ant without breaking functionality. For this reason, this task always forks the VM. This overhead is not significant since javadoc is normally a heavy application and will be called infrequently."

Using that we had to hack the ${HOME}/.maven/plugins/maven-javadoc-plugin-1.3/plugin.jelly
file to accept the "maxmemory" attribute.

example:
<ant:javadoc
packagenames="${pom.package}.*"
maxmemory="${maven.javadoc.maxmemory}"
destdir="${maven.javadoc.destdir}"
author="${maven.javadoc.author}"
public="${maven.javadoc.public}"
package="${maven.javadoc.package}"
private="${maven.javadoc.private}"
version="${maven.javadoc.version}"
use="${maven.javadoc.use}"
windowtitle="${maven.javadoc.windowtitle}"
doctitle="${maven.javadoc.windowtitle}"
bottom="${copyright}"
stylesheetfile="${maven.javadoc.stylesheet}"
additionalparam="${maven.javadoc.additionalparam}"
useexternalfile="${maven.javadoc.useexternalfile}">

Now we get past the javadoc and junit OutOfMemoryErrors, but the tasklist-plugin (vdoclet is the issue here), and linkcheck-plugin are still causing OutOfMemory and StackOverflow problems.

The smaller of the two projects (1581 classes) generates a 5110 html files. linkcheck does not like dealing with this many html files.

If the ratio of generated html to project classes (3.23) holds even (which is unlikely), then the larger project (4166 classes) would generate 13,456 html files! (eek! that would be a horrid site:deploy, hmmm, wonder if a site:rsyncdeploy would be a good idea?)

Personal Conclusion:

  • junit issue can be resolved within existing codebase.
  • javadoc needs to add the maxmemory attribute, property to set it, a default to work off of (256MB?) and documentation. I'll be happy to write up a quick patch for this when I get back home (I have no cvs access at the office).
  • tasklist needs work, it cannot be forked (yet).
  • linkcheck needs work, it cannot be forked, looks like it needs to be refactored to handle large projects.

Ideas generated from this effort:

  • would a site:rsyncdeploy be something desired? (not for v1.0, but how about v1.1?)
  • a different tasklist approach, not using vdoclet / velocity, but some other approach (antlr parsing to xml?), and to include "@todo", "TODO", "XXX", "FIXME" comments too be warranted?
  • A tool to generate large dummy projects for testing build tools such as maven / ant / plugins / etc should be created to help test things. (JDummyProject?)
Show
Joakim Erdfelt added a comment - 21/Oct/03 10:45 AM I cannot include older ant script (due to corporate security policy), besides, after neutering it would be useless to you, (I think). Ok, some success with javadoc and junit, but the tasklist and linkcheck are still issues. junit: setting the folling in the project.properties helps with junit. maven.junit.jvmargs = -Xmx1024m maven.junit.fork = true javadoc: Since according to the ant manual at http://ant.apache.org/manual/CoreTasks/javadoc.html, it states ... "NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the same VM as ant without breaking functionality. For this reason, this task always forks the VM. This overhead is not significant since javadoc is normally a heavy application and will be called infrequently." Using that we had to hack the ${HOME}/.maven/plugins/maven-javadoc-plugin-1.3/plugin.jelly file to accept the "maxmemory" attribute. example: <ant:javadoc packagenames="${pom.package}.*" maxmemory="${maven.javadoc.maxmemory}" destdir="${maven.javadoc.destdir}" author="${maven.javadoc.author}" public="${maven.javadoc.public}" package="${maven.javadoc.package}" private="${maven.javadoc.private}" version="${maven.javadoc.version}" use="${maven.javadoc.use}" windowtitle="${maven.javadoc.windowtitle}" doctitle="${maven.javadoc.windowtitle}" bottom="${copyright}" stylesheetfile="${maven.javadoc.stylesheet}" additionalparam="${maven.javadoc.additionalparam}" useexternalfile="${maven.javadoc.useexternalfile}"> Now we get past the javadoc and junit OutOfMemoryErrors, but the tasklist-plugin (vdoclet is the issue here), and linkcheck-plugin are still causing OutOfMemory and StackOverflow problems. The smaller of the two projects (1581 classes) generates a 5110 html files. linkcheck does not like dealing with this many html files. If the ratio of generated html to project classes (3.23) holds even (which is unlikely), then the larger project (4166 classes) would generate 13,456 html files! (eek! that would be a horrid site:deploy, hmmm, wonder if a site:rsyncdeploy would be a good idea?) Personal Conclusion:
  • junit issue can be resolved within existing codebase.
  • javadoc needs to add the maxmemory attribute, property to set it, a default to work off of (256MB?) and documentation. I'll be happy to write up a quick patch for this when I get back home (I have no cvs access at the office).
  • tasklist needs work, it cannot be forked (yet).
  • linkcheck needs work, it cannot be forked, looks like it needs to be refactored to handle large projects.
Ideas generated from this effort:
  • would a site:rsyncdeploy be something desired? (not for v1.0, but how about v1.1?)
  • a different tasklist approach, not using vdoclet / velocity, but some other approach (antlr parsing to xml?), and to include "@todo", "TODO", "XXX", "FIXME" comments too be warranted?
  • A tool to generate large dummy projects for testing build tools such as maven / ant / plugins / etc should be created to help test things. (JDummyProject?)
Hide
Permalink
dion gillard added a comment - 21/Oct/03 7:30 PM

the current javadoc plugin already allows a maven.javadoc.maxmemory property to be specified.

Show
dion gillard added a comment - 21/Oct/03 7:30 PM the current javadoc plugin already allows a maven.javadoc.maxmemory property to be specified.
Hide
Permalink
Joakim Erdfelt added a comment - 22/Oct/03 9:49 AM

After getting the last update to this jira, we were very confused, as our ${HOME}/.maven/plugins/maven-javadoc-plugin-1.3/plugin.jelly does make mention of the max memory as a <ant:setProperty> child of <ant:javadoc> but it was not working for us.

NOTE: we had a maven-javadoc-plugin-1.3 and maven-javadoc-pluging-1.3-SNAPSHOT in our ${HOME}/.maven/plugins directory.

At this point we are now very suspect of our install of maven.

We rm the maven install directory, the ${HOME}/.maven/ directory, any ${HOME}/build.properties files, and all of our files on our mavenproxy/repository file server too.

Went for a "Clean Slate" you can say.

We re-downloaded the maven-1.0-rc1 and tried again.

Reference of what we are using now.
[erdfeltj@host-foo:maven]$ md5sum maven-1.0-rc1.tar.gz
7f5e787ff3b930d906d01243ccf7c237 *maven-1.0-rc1.tar.gz

[erdfeltj@host-foo:maven]$ tar -ztvf maven-1.0-rc1.tar.gz | grep maven-javadoc
rw-rr- 0/0 6672 2003-09-29 01:57:03 maven-1.0-rc1/plugins/maven-javadoc-plugin-1.3.jar

and when we set the following properties in our project.properties file the javadoc and junit work without an OutOfMemoryError, but the tasklist-plugin and linkcheck-plugin still cause us issues.

maven.javadoc.additionalparam = -breakiterator
maven.javadoc.useexternalfile = yes
maven.javadoc.maxmemory = 512
maven.jcoverage.junit.fork = true
maven.junit.jvmargs = -Xmx512m
maven.junit.fork = true

We get a reduced upper memory limit to our compile process to boot! glee

Now we need to solve the tasklist and linkcheck issues.
I can't seem to find a plugin-tasklist jira component. (but I do see a plugin-linkcheck component). Should I resubmit this under those components ?

Show
Joakim Erdfelt added a comment - 22/Oct/03 9:49 AM After getting the last update to this jira, we were very confused, as our ${HOME}/.maven/plugins/maven-javadoc-plugin-1.3/plugin.jelly does make mention of the max memory as a <ant:setProperty> child of <ant:javadoc> but it was not working for us. NOTE: we had a maven-javadoc-plugin-1.3 and maven-javadoc-pluging-1.3-SNAPSHOT in our ${HOME}/.maven/plugins directory. At this point we are now very suspect of our install of maven. We rm the maven install directory, the ${HOME}/.maven/ directory, any ${HOME}/build.properties files, and all of our files on our mavenproxy/repository file server too. Went for a "Clean Slate" you can say. We re-downloaded the maven-1.0-rc1 and tried again. Reference of what we are using now. [erdfeltj@host-foo:maven]$ md5sum maven-1.0-rc1.tar.gz 7f5e787ff3b930d906d01243ccf7c237 *maven-1.0-rc1.tar.gz [erdfeltj@host-foo:maven]$ tar -ztvf maven-1.0-rc1.tar.gz | grep maven-javadoc rw-rr- 0/0 6672 2003-09-29 01:57:03 maven-1.0-rc1/plugins/maven-javadoc-plugin-1.3.jar and when we set the following properties in our project.properties file the javadoc and junit work without an OutOfMemoryError, but the tasklist-plugin and linkcheck-plugin still cause us issues. maven.javadoc.additionalparam = -breakiterator maven.javadoc.useexternalfile = yes maven.javadoc.maxmemory = 512 maven.jcoverage.junit.fork = true maven.junit.jvmargs = -Xmx512m maven.junit.fork = true We get a reduced upper memory limit to our compile process to boot! glee Now we need to solve the tasklist and linkcheck issues. I can't seem to find a plugin-tasklist jira component. (but I do see a plugin-linkcheck component). Should I resubmit this under those components ?

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (3)
Watch (2)

Dates

  • Created:
    22/Aug/03 5:01 AM
    Updated:
    11/Dec/05 10:53 AM
    Resolved:
    11/Dec/05 10:53 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.