Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.0.0RC2
    • Fix Version/s: JRuby 1.0.2, JRuby 1.1b1
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Number of attachments :
      1

      Description

      Using Fedora Linux 6 on an AMD Opteron-based system, with JDK 1.6.0 and JRuby 1.0.0RC2, all attempts to install the rails gem fail with an OutOfMemoryError. The stack trace differs slightly each time, but it is happening while processing a yaml file (see attachment).

      I was hoping to run my Rails projects using JRuby in Glassfish, but I can't even get Rails installed using JRuby. This bug blocks all progress in that direction.

      1. trace.txt
        3 kB
        Nathan Fiedler

        Activity

        Hide
        Ricardo Trindade added a comment -

        Just noticed that this seems to occur on the "bulk updating..." phase, so perhaps it's got something to do with the number of gems installed ? I've got 20.

        specifying the max memory fixes the install (as expected)

        Show
        Ricardo Trindade added a comment - Just noticed that this seems to occur on the "bulk updating..." phase, so perhaps it's got something to do with the number of gems installed ? I've got 20. specifying the max memory fixes the install (as expected)
        Hide
        Charles Oliver Nutter added a comment -

        This was fixed on both trunk and 1_0 branch 'gem' scripts by specifying -J-Xmx384M in the shebang. We don't want to bump up the max heap for the normal jruby command right now, especially since you can just specify it yourself.

        Show
        Charles Oliver Nutter added a comment - This was fixed on both trunk and 1_0 branch 'gem' scripts by specifying -J-Xmx384M in the shebang. We don't want to bump up the max heap for the normal jruby command right now, especially since you can just specify it yourself.
        Hide
        Ricardo Trindade added a comment -

        running "gem update" still throws the same exception on my system. running through jruby and specifying 512Mb max heap works. Maybe 384Mb is not enough ? I have 22 gems installed, including rails.

        Show
        Ricardo Trindade added a comment - running "gem update" still throws the same exception on my system. running through jruby and specifying 512Mb max heap works. Maybe 384Mb is not enough ? I have 22 gems installed, including rails.
        Hide
        Dylan Vaughn added a comment -

        FYI, the fix that Charles made to the gem script shebang breaks on linux:

        dylan@dylan:~/workspace/jruby_test$ $JRUBY_HOME/bin/gem list
        /usr/bin/env: jruby -J-Xmx384M: No such file or directory

        I believe this is due to linux's shebang handling:

        http://en.wikipedia.org/wiki/Shebang_(Unix)#Portability

        workaround is to call gem via:

        jruby -S gem list

        or

        jruby -J-Xmx384M -S gem install rails -y --no-ri --no-rdoc

        Show
        Dylan Vaughn added a comment - FYI, the fix that Charles made to the gem script shebang breaks on linux: dylan@dylan:~/workspace/jruby_test$ $JRUBY_HOME/bin/gem list /usr/bin/env: jruby -J-Xmx384M: No such file or directory I believe this is due to linux's shebang handling: http://en.wikipedia.org/wiki/Shebang_(Unix)#Portability workaround is to call gem via: jruby -S gem list or jruby -J-Xmx384M -S gem install rails -y --no-ri --no-rdoc
        Hide
        Erno Mononen added a comment -

        I'm running into this with 1.1.2 when trying to install rails. Apparently the default Xmx (500m?) is not enough, increasing it to 700m seems to help.

        erno@satumaa:~$ java -version
        java version "1.5.0_15"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
        Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_15-b04, mixed mode)

        erno@satumaa:~$ jruby -v
        ruby 1.8.6 (2008-05-28 rev 6586) [amd64-jruby1.1.2]

        erno@satumaa:~$ jruby -S gem install rails --no-ri --no-rdoc

        => results in
        Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at org.jruby.runtime.ThreadContext.popFrameReal(ThreadContext.java:354)
        at org.jruby.runtime.ThreadContext.postYield(ThreadContext.java:889)
        ...

        Show
        Erno Mononen added a comment - I'm running into this with 1.1.2 when trying to install rails. Apparently the default Xmx (500m?) is not enough, increasing it to 700m seems to help. erno@satumaa:~$ java -version java version "1.5.0_15" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_15-b04, mixed mode) erno@satumaa:~$ jruby -v ruby 1.8.6 (2008-05-28 rev 6586) [amd64-jruby1.1.2] erno@satumaa:~$ jruby -S gem install rails --no-ri --no-rdoc => results in Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at org.jruby.runtime.ThreadContext.popFrameReal(ThreadContext.java:354) at org.jruby.runtime.ThreadContext.postYield(ThreadContext.java:889) ...

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Nathan Fiedler
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: