Issue Details (XML | Word | Printable)

Key: JRUBY-2684
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vladimir Sizikov
Reporter: Erno Mononen
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

gem management requires too much memory

Created: 20/Jun/08 08:54 AM   Updated: 10/Sep/08 06:47 PM   Resolved: 26/Jun/08 08:38 AM
Return to search
Component/s: None
Affects Version/s: JRuby 1.1.2
Fix Version/s: JRuby 1.1.3

Time Tracking:
Not Specified

Environment:
Linux satumaa 2.6.24-19-generic #1 SMP Wed Jun 4 15:10:52 UTC 2008 x86_64 GNU/Linux


 Description  « Hide

Gem management (listing remote gems, installing new ones) seems to require huge amounts of memory on my configuration. Without increasing Xmx I get OOEM everytime with the following command:

erno@satumaa:~$ jruby -S gem list --remote

      • REMOTE GEMS ***

Bulk updating Gem source index for: http://gems.rubyforge.org/
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.TreeMap$Values.iterator(TreeMap.java:932)
at org.jvyamlb.ScannerImpl.nextPossibleSimpleKey(ScannerImpl.java:857)
at org.jvyamlb.ScannerImpl.needMoreTokens(ScannerImpl.java:472)
at org.jvyamlb.ScannerImpl.peekToken(ScannerImpl.java:422)
...

Also with 600m:

erno@satumaa:~$ jruby -J-Xmx600m -S gem list --remote

      • REMOTE GEMS ***

Bulk updating Gem source index for: http://gems.rubyforge.org/
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at org.jruby.util.ByteList.grow(ByteList.java:635)
...

If I set the Xmx param to > 1G then the command succeeds.

Tried with JDK 6:
java version "1.6.0_10-beta"
Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b14)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b11, mixed mode)

And JDK 5:
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)

And got OOEM on both.

JRuby:
ruby 1.8.6 (2008-05-28 rev 6586) [amd64-jruby1.1.2]

Gem Env:
erno@satumaa:~$ jruby -S gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.1.1
  • RUBY VERSION: 1.8.6 (2008-05-28 patchlevel 6586) [java]
  • INSTALLATION DIRECTORY: /home/erno/jruby/jruby-1.1.2/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: /home/erno/jruby/jruby-1.1.2/bin/jruby
  • RUBYGEMS PLATFORMS:
  • ruby
  • universal-java-1.6
  • GEM PATHS:
  • /home/erno/jruby/jruby-1.1.2/lib/ruby/gems/1.8
  • GEM CONFIGURATION:
  • :update_sources => true
  • :verbose => true
  • :benchmark => false
  • :backtrace => false
  • :bulk_threshold => 1000
  • :sources => ["http://gems.rubyforge.org", "http://gems.rubyonrails.org"]
  • REMOTE SOURCES:
  • http://gems.rubyforge.org
  • http://gems.rubyonrails.org


Vladimir Sizikov added a comment - 20/Jun/08 11:46 AM

We'll switch to newer rubygems 1.2 soon, and as far as I can tell, the memory requirement will be significantly reduced in the new rubygems version.


Vladimir Sizikov added a comment - 26/Jun/08 08:38 AM

We upgraded to rubygems 1.2, and the memory requirements significantly reduced (40MB instead of 600MB!!!).


Erno Mononen added a comment - 26/Jun/08 08:49 AM

Wow! Looking forward to 1.1.3, we'll need to upgrade the version we bundle with NB as soon as possible then.