JRuby

ant task api-docs runs out of memory, patch included

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.5
  • Fix Version/s: JRuby 1.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    MacOS 10.5.5 Java 1.5.0_16
  • Patch Submitted:
    Yes
  • Number of attachments :
    0

Description

Running the ant task api-docs to generate the Javadoc runs out of memory on my MacOS 10.5.5 system running Java 1.5.0_16:

[javadoc] javadoc: error - java.lang.OutOfMemoryError: Please increase memory.
  [javadoc] For example, on the Sun Classic or HotSpot VMs, add the option -J-Xmx
  [javadoc] Generating /Users/stephen/dev/ruby/src/jruby.git/docs/api/serialized-form.html...
  [javadoc] 5 errors
  [javadoc] 324 warnings
  [javadoc] such as -J-Xmx32m.

BUILD SUCCESSFUL
Total time: 8 minutes 18 seconds

Adding attribute: maxmemory="128m" fixes this problem and decreases the time to build the javadoc from over 8 minutes to under 40s:

[javadoc] Building index for all classes...
  [javadoc] Generating /Users/stephen/dev/ruby/src/jruby.git/docs/api/stylesheet.css...
  [javadoc] 4 errors
  [javadoc] 325 warnings

BUILD SUCCESSFUL
Total time: 39 seconds

patch:

diff --git a/build.xml b/build.xml
index 36c5177..d7db139 100644
--- a/build.xml
+++ b/build.xml
@@ -1051,7 +1051,8 @@
   <target name="create-apidocs" depends="prepare" 
           description="Creates the Java API docs">
     <javadoc destdir="${api.docs.dir}" author="true" version="true" use="true" 
-             windowtitle="JRuby API" source="${javac.version}" useexternalfile="true">
+             windowtitle="JRuby API" source="${javac.version}" useexternalfile="true"
+             maxmemory="128m">
       <fileset dir="${src.dir}">
         <include name="**/*.java"/>
       </fileset>

Activity

Hide
Thomas E Enebo added a comment -

Patch applied in commit 8379. Thanks Stephen.

Show
Thomas E Enebo added a comment - Patch applied in commit 8379. Thanks Stephen.
Hide
James Le Cuirot added a comment -

Both I and a Gentoo developer have found that 128MB isn't enough. Maybe the amount of source code significantly increased between when this was added and when 1.2 was released. Or maybe 1.6, which I'm using, requires more memory. I think the Gentoo guy was using 1.7. I tried 256MB and that worked well. I also tried 192MB and that worked but it seemed to take longer. Can this be increased?

Show
James Le Cuirot added a comment - Both I and a Gentoo developer have found that 128MB isn't enough. Maybe the amount of source code significantly increased between when this was added and when 1.2 was released. Or maybe 1.6, which I'm using, requires more memory. I think the Gentoo guy was using 1.7. I tried 256MB and that worked well. I also tried 192MB and that worked but it seemed to take longer. Can this be increased?
Hide
Gioele Barabucci added a comment -

This problem is still present in JRuby 1.5.0RC1. Changing the build.xml file to allocate more memory it is possible to work around the problem.

Isn't there a way to permanently fix this problem?

Show
Gioele Barabucci added a comment - This problem is still present in JRuby 1.5.0RC1. Changing the build.xml file to allocate more memory it is possible to work around the problem. Isn't there a way to permanently fix this problem?
Hide
Thomas E Enebo added a comment -

I updated the value for this to 256m on master in commit ced654a and on 1.5 branch 9dcb4d1. Thanks for re-pinging on this.

Show
Thomas E Enebo added a comment - I updated the value for this to 256m on master in commit ced654a and on 1.5 branch 9dcb4d1. Thanks for re-pinging on this.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: