java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)

时间:2014-04-19 11:51:12

标签: java ruby-on-rails rbenv

我在本地rbenv webrick服务器上运行RAILS应用程序,我经常收到此错误并且服务器停止,请指教我

 java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)
    Exception in thread "RubyThread-3337: /usr/local/rbenv/versions/jruby-1.7.3/lib/ruby/1.9/webrick/server.rb:103" java.lang.InternalError: identity=Lambda(a0:L,a1:L,a2:L)=>{
        t3:L=Species_L.argL0(a0:L);
        t4:L=ValueConversions.identity(t3:L);t4:L}
        at java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)
        at java.lang.invoke.LambdaForm.compileToBytecode(LambdaForm.java:460)
        at java.lang.invoke.LambdaForm.checkInvocationCounter(LambdaForm.java:634)
        at rubyjit.WEBrick::GenericServer$$start_thread_7B70F846F4B96CB34E341FFAE1CC88FEEAA8EA95520186210.chained_1_rescue_1$RUBY$SYNTHETIC__file__(/usr/local/rbenv/versions/jruby-1.7.3/lib/ruby/1.9/webrick/server.rb:191)
        at rubyjit.WEBrick::GenericServer$$start_thread_7B70F846F4B96CB34E341FFAE1CC88FEEAA8EA95520186210.chained_0_ensure_1$RUBY$__ensure__(/usr/local/rbenv/versions/jruby-1.7.3/lib/ruby/1.9/webrick/server.rb)
        at rubyjit.WEBrick::GenericServer$$start_thread_7B70F846F4B96CB34E341FFAE1CC88FEEAA8EA95520186210.block_0$RUBY$__file__(/usr/local/rbenv/versions/jruby-1.7.3/lib/ruby/1.9/webrick/server.rb:181)
        at rubyjit$WEBrick::GenericServer$$start_thread_7B70F846F4B96CB34E341FFAE1CC88FEEAA8EA95520186210$block_0$RUBY$__file__.call(rubyjit$WEBrick::GenericServer$$start_thread_7B70F846F4B96CB34E341FFAE1CC88FEEAA8EA95520186210$block_0$RUBY$__file__)
        at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:163)
        at org.jruby.runtime.CompiledBlock19.call(CompiledBlock19.java:91)
        at org.jruby.runtime.Block.call(Block.java:89)
        at org.jruby.RubyProc.call(RubyProc.java:261)
        at org.jruby.RubyProc.call(RubyProc.java:213)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:98)
        at java.lang.Thread.run(Thread.java:744)
    Caused by: java.lang.OutOfMemoryError: PermGen space
    [2014-04-19 16:37:20] ERROR Java::JavaLang::InternalError: identity=Lambda(a0:L,a1:L,a2:L)=>{
        t3:L=Species_L.argL0(a0:L);
        t4:L=ValueConversions.identity(t3:L);t4:L}
        java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)
    [2014-04-19 16:37:21] ERROR Java::JavaLang::InternalError: guard=Lambda(a0:L,a1:L,a2:L)=>{
        t3:I=MethodHandle(AbstractScript,ThreadContext)boolean(a1:L,a2:L);
        t4:L=MethodHandleImpl.selectAlternative(t3:I,(MethodHandle(AbstractScript,ThreadContext)IRubyObject),(MethodHandle(AbstractScript,ThreadContext)IRubyObject));

1 个答案:

答案 0 :(得分:0)

  

引起:java.lang.OutOfMemoryError:PermGen space

permgen是内存中的一个位置,其中存储了加载的类(显然,在本例中为lambdas)。默认情况下它的大小不会增加。您可以将以下启动选项传递给Java(或将其放在JAVA_OPTS环境变量中):

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

允许它卸载类并尝试收集PermGen空间。当然,如果你需要一次加载的很多类,你可以用

增加PermGen空间
-XX:MaxPermSize=SIZE

128M是一个合理的值,虽然我无法知道你的应用程序是如何类和lambda重的。