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
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
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

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.