jvm crash,疑似GC的bug

阅读更多
在对一个应用做压力的时候,不定时发生jvm crash,查看hs_error.log
内容摘要如下:

Current thread (0x0000000051f8f800):  GCTaskThread [stack: 0x00000000413c2000,0x00000000414c3000] [id=15399]

Heap
PSYoungGen      total 348288K, used 347520K [0x00002aaae0cb0000, 0x00002aaaf6200000, 0x00002aaaf6200000)
  eden space 347072K, 100% used [0x00002aaae0cb0000,0x00002aaaf5fa0000,0x00002aaaf5fa0000)
  from space 1216K, 36% used [0x00002aaaf5fa0000,0x00002aaaf6010000,0x00002aaaf60d0000)
  to   space 1152K, 50% used [0x00002aaaf60e0000,0x00002aaaf6170000,0x00002aaaf6200000)
PSOldGen        total 699072K, used 324379K [0x00002aaab6200000, 0x00002aaae0cb0000, 0x00002aaae0cb0000)
  object space 699072K, 46% used [0x00002aaab6200000,0x00002aaac9ec6f40,0x00002aaae0cb0000)
PSPermGen       total 65536K, used 34650K [0x00002aaaae200000, 0x00002aaab2200000, 0x00002aaab6200000)
  object space 65536K, 52% used [0x00002aaaae200000,0x00002aaab03d68d8,0x00002aaab2200000)


看样子似乎是GC的时候crash掉了,heap的状态是eden space  100% used,看样子是在eden区转移到survival区时,由于某些原因crash。

鉴于jvm启动时使用的gc为ParallelGC,于是试着换成串行GC和并行GC,压了18个小时都没有发生crash。
使用的环境是64位 liunx系统,java 1.6.0_18 64bit。
初步怀疑是ParallelGC在并发回收处理eden区内存对象的时候的bug导致,在64位机器和32位机器上都有这个问题。
不知道大家有没有碰到过这个问题?


疑似jdk 6u18 的 bug
http://www.oracle.com/technetwork/java/javase/6u18-142093.html

#
Card-Marking Optimization Issue
#

A flaw in the implementation of a card-marking performance optimization in the JVM can cause heap corruption under some circumstances. This issue affects the CMS garbage collector prior to 6u18, and the CMS, G1 and Parallel Garbage Collectors in 6u18. The serial garbage collector is not affected. Applications most likely to be affected by this issue are those that allocate very large objects which would not normally fit in Eden, or those that make extensive use of JNI Critical Sections (JNI Get/Release*Critical).

This issue will be fixed in the next Java SE 6 update.

Meanwhile, as a workaround to the issue, users should disable this performance optimization by -XX:-ReduceInitialCardMarks.

你可能感兴趣的:(JVM,JNI,CMS,Oracle,performance)