我在本地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));

最佳答案

引起原因:java.lang.OutOfMemoryError:PermGen空间


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

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled


以允许它卸载类并尝试收集PermGen空间。当然,如果您一次需要加载很多类,则可以使用以下方法增加PermGen空间:

-XX:MaxPermSize=SIZE


128M是一个合理的值,尽管我无法知道您的应用程序的类和lambda繁重程度如何。

关于java - java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23169695/

10-13 04:57