Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.OutOfMemoryError #71

Open
patrickhno opened this issue Jun 17, 2011 · 5 comments
Open

java.lang.OutOfMemoryError #71

patrickhno opened this issue Jun 17, 2011 · 5 comments

Comments

@patrickhno
Copy link

Suddenly cucumber stopped working, and there really isn't any good way to debug into the java stuff.
It fails on the very first step (Given I am on ...)
I takes forever before it barfs.

You will see versions in the stack trace.
We would very much like to use akephalos so if there is anything we could tweek right away feel free to come with sugestions.
We have allready invested into rewriting our framework to use the akephalos and it's just mind blowing it suddenly stopped working. But I guess that's how it is with memory and heaps. Once the threshold is passed, nothing works.

@sok @wip
Scenario: Search up a central and verify router information # features/sok/lsok_2e/central_port_info.feature:24
Given I am on the Sentralsøk page # features/step_definitions/web_steps.rb:19
"http://pathan.new.lsd/sok/lsok_1.php"
java.lang.OutOfMemoryError: Java heap space (NativeException)
(druby://127.0.0.1:53365) org/jruby/RubyKernel.java:2063:in send' (druby://127.0.0.1:53365) org/jruby/RubyKernel.java:1419:inloop'
(druby://127.0.0.1:53365) org/jruby/RubyProc.java:268:in call' (druby://127.0.0.1:53365) org/jruby/RubyProc.java:232:incall'
./features/step_definitions/web_steps.rb:20:in /^(?:|I )am on (.+)$/' features/sok/lsok_2e/central_port_info.feature:25:inGiven I am on the Sentralsøk page'
And I search for a central # features/step_definitions/page_object_steps.rb:327
Then DEBUG I should see a central # features/step_definitions/page_object_steps.rb:49
Given I follow Router on the central # features/step_definitions/page_object_steps.rb:188
Then I should see "Sentral utstyr" # features/step_definitions/web_steps.rb:107
java.lang.OutOfMemoryError: Java heap space (NativeException)
(druby://127.0.0.1:53365) /home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/akephalos-0.2.5/lib/akephalos/client.rb:107:in page' (druby://127.0.0.1:53365) org/jruby/RubyKernel.java:2059:insend'
(druby://127.0.0.1:53365) file:/home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/jruby-jars-1.6.2/lib/jruby-stdlib-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1593:in perform_without_block' (druby://127.0.0.1:53365) file:/home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/jruby-jars-1.6.2/lib/jruby-stdlib-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1553:inperform'
(druby://127.0.0.1:53365) file:/home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/jruby-jars-1.6.2/lib/jruby-stdlib-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1627:in main_loop' (druby://127.0.0.1:53365) org/jruby/RubyKernel.java:1419:inloop'
(druby://127.0.0.1:53365) file:/home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/jruby-jars-1.6.2/lib/jruby-stdlib-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1623:in main_loop' (druby://127.0.0.1:53365) org/jruby/RubyProc.java:268:incall'
(druby://127.0.0.1:53365) org/jruby/RubyProc.java:232:in call' /home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/akephalos-0.2.5/lib/akephalos/capybara.rb:291:inpage'
/home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/akephalos-0.2.5/lib/akephalos/capybara.rb:217:in body' /home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/capybara-0.4.1.2/lib/capybara/session.rb:89:inbody'
/home/pathan/www/lsd/tests/cucumber/features/support/ventelo.rb:10:in `After'
Exception in thread "RubyThread-6: file:/home/pathan/.rvm/gems/ruby-1.9.2-p180/gems/jruby-jars-1.6.2/lib/jruby-stdlib-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1619" java.lang.NullPointerException
at org.jruby.javasupport.JavaClass.installClassFields(JavaClass.java:834)
at org.jruby.javasupport.JavaClass.setupProxy(JavaClass.java:701)
at org.jruby.javasupport.Java.createProxyClass(Java.java:524)
at org.jruby.javasupport.Java.getProxyClass(Java.java:453)
at org.jruby.javasupport.Java.getInstance(Java.java:362)
at org.jruby.javasupport.JavaUtil.convertJavaToUsableRubyObject(JavaUtil.java:165)
at org.jruby.javasupport.util.RuntimeHelpers.checkJavaException(RuntimeHelpers.java:1029)
at org.jruby.javasupport.util.RuntimeHelpers.isJavaExceptionHandled(RuntimeHelpers.java:1053)
at org.jruby.ast.RescueNode.handleJavaException(RescueNode.java:197)
at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:141)
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:295)
at org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:229)
at org.jruby.runtime.Block.yieldSpecific(Block.java:99)
at org.jruby.RubyKernel.loop(RubyKernel.java:1419)
at org.jruby.RubyKernel$s$0$0$loop.call(RubyKernel$s$0$0$loop.gen:65535)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:112)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:123)
at org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:328)
at org.jruby.runtime.BlockBody.call(BlockBody.java:73)
at org.jruby.runtime.Block.call(Block.java:89)
at org.jruby.RubyProc.call(RubyProc.java:268)
at org.jruby.RubyProc.call(RubyProc.java:232)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:95)
at java.lang.Thread.run(Thread.java:636)

@patrickhno
Copy link
Author

I changed -Xmx128M to -Xms512 and it resolved the issue for me.
Id be happy to commit if I knew how to attach code to this issue :-)

java_args = [
  "-Xmx512M",
  "-cp", [JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path].join(":"),
  "org.jruby.Main"
]

@Nerian
Copy link
Contributor

Nerian commented Jun 22, 2011

You can use this fork https://github.com/Nerian/akephalos. It gives more memory to the JVM.

@patrickhno
Copy link
Author

Java is so perfect..
Should'nt this really be a option? I hardcoded the changes myself for now.

@Nerian
Copy link
Contributor

Nerian commented Jun 30, 2011

That's is a nice idea. I will look at the code this afternoon.

@Nerian
Copy link
Contributor

Nerian commented Jul 2, 2011

@patrickhno

I gave it a try and cooked this.

https://github.com/Nerian/akephalos/tree/jvm

Akephalos' tests pass but I haven't a full app using akephalos to try this. Does it work in your app?:

Gemfile.

gem 'akephalos', :git=>'git://github.com/Nerian/akephalos.git', :branch => 'jvm'

spec_helper.

Capybara.register_driver :akephalos do |app| 
  Capybara::Driver::Akephalos.new(app, :jvm_max_memory => '512')
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants