更新为Java 6 Update 14后的JVM错误 [英] JVM errors after updating to Java 6 Update 14

查看:104
本文介绍了更新为Java 6 Update 14后的JVM错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将少数服务器更新为在Java 6 update 14上运行后,我一直遇到一些奇怪的错误(也许每天一次).

I've been getting some strange errors ( perhaps once per day ) after updating a handful of servers to run on Java 6 update 14.

错误类似于

#
# A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 1759920 bytes for Chunk::new. Out of swap space?
#
#  Internal Error (allocation.cpp:215), pid=26706, tid=317545360
#  Error: Chunk::new
#
# JRE version: 6.0_14-b08
# Java VM: Java HotSpot(TM) Server VM (14.0-b16 mixed mode linux-x86 )
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

足够好,当前线程是编译器

Stragely enough, the current thread is the compiler

  0x088a0800 JavaThread "CompilerThread1" daemon [_thread_blocked, id=26716, stack(0x12c7f000,0x12d00000)]
=>0x0889e400 JavaThread "CompilerThread0" daemon [_thread_in_native, id=26715, stack(0x12e55000,0x12ed6000)]

并且有足够的可用内存:

and there is more than enough memory available:

 PSYoungGen      total 256064K, used 93533K [0xa2cd0000, 0xb4290000, 0xb4290000)
  eden space 228352K, 31% used [0xa2cd0000,0xa72d6308,0xb0bd0000)
  from space 27712K, 78% used [0xb2780000,0xb3cd1150,0xb4290000)
  to   space 28032K, 0% used [0xb0bd0000,0xb0bd0000,0xb2730000)
 PSOldGen        total 2275584K, used 885858K [0x17e90000, 0xa2cd0000, 0xa2cd0000)
  object space 2275584K, 38% used [0x17e90000,0x4dfa8bf8,0xa2cd0000)
 PSPermGen       total 32128K, used 27819K [0x13e90000, 0x15df0000, 0x17e90000)
  object space 32128K, 86% used [0x13e90000,0x159bac50,0x15df0000)

我知道JVM崩溃很难调试,但是我很好奇你们中的任何一个是否遇到过类似的问题-以及如何解决它们.

I known JVM crashes are hard to debug, but I'm curious if any of you encountered similar issues - and how did you solve them.

推荐答案

您遇到的错误不是Java代码错误,而是一个Jit编译器中的问题.当Jit启动时,它会占用大量内存作为其实际功能的内存).此内存来自本机堆.

The bug you are getting is not a Java code bug, but rather an issue in one of the Jit compilers. When the Jit starts up it snags a bunch of memory as memory for what it actaully does). This memory comes from the native heap.

对于真正感兴趣的,此错误最终在VM中从这里发出(前面的C ++代码)

For the really interested this error emits ultimatly from here in the VM (C++ code ahead) http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#aRIt9pqzOVI/src/share/vm/utilities/vmError.cpp&q=OutOfMemoryError%20Out%20of%20swap%20space&l=258 unfortunatly its not a "real" OutOfMemoryError, it wont behave according to the normal rules, you cant catch it etc.

本机(JNI/JNA)方法可以直接从OS分配内存. NIO直接使用内存,热点编译器,还有其他

Native (JNI/JNA) methods can directly allocate memory from the OS. NIO uses memory directly, hotspot compiler, and there are others

此内存是应用程序本机堆(由malloc和friends管理的东西)的一部分,您的应用程序可能用完了本机堆,导致发生这种情况,请查看包装盒上的整体内存,ulimit设置等.如果JNI/JNA代码能够耗尽应用程序用于本机代码的可用内存,它们也可以在某种程度上发挥作用.从NIO看一下DirectMappedBuffers,因为它们也会从Java堆中窃取内存.

This memory is part of the applications native heap (the stuff managed by malloc and friends), it is possible that your application has run out of native heap causing this to occur, take a look at overall memory on the box, ulimit settings etc. JNI / JNA code can also play into this somewhat, if they are able to exhaust the available memory the application has for native code. Take a look for DirectMappedBuffers from NIO as these can also steal memory off java heap.

鉴于您刚刚更新了某个Jit编译器内部的错误,很有可能,GC和Jit设置可能会影响此错误,因此请尝试将jit(从-client更改为-server或将-server更改为-客户端)以查看是否有效果,您还可以尝试更改GC策略(但是请记住,您正在更改GC策略以更改其与jit的交互,而不是解决Java内存问题).

It is quite possible given that you have just updated that you might have hit a bug inside one of the Jit compilers, GC and Jit settings can influence this so try changing the jit (-client to -server or -server to -client) to see if that has any effect, you can also try changing the GC policy (however remember that you are changing the GC policy to alter its interactions with the jit and not to fix a java memory issue).

您还可以使用命令行标志-Djava.compiler = NONE完全关闭Jit,但是由于这会删除任何本机代码生成,因此会损害您的性能.

You can also turn the Jit off completly with the command line flag -Djava.compiler=NONE, however as this removes any native code generation it will hurt your performance.

除此之外,如果您将hprof崩溃文件托管在某个地方,我也许可以为您提供更多建议.

Outside of that, if you host the hprof crash file somewhere I might be able to give you some more ideas.

这篇关于更新为Java 6 Update 14后的JVM错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆