JVM crashes constantly when High GC happens

Kim Barrett kim.barrett at oracle.com
Fri Apr 5 19:15:03 UTC 2019


> On Apr 4, 2019, at 10:16 PM, shang xinli <shangxinli at hotmail.com> wrote:
> 
> Hi all,
> 
> We hit crashes pretty constantly when the GC is high when using CMS GC. We switched to G1GC but it still crashes at the same places. It also crashes with the newest version of JDK. Anybody has a clue how to investigate why? 

What's happening here is a segfault in oopDesc::size(), apparently
obtaining the klass() of the object. This suggests a corrupted object
or a NULL that was expected to be a real object. Since you report it
happens with different collectors (both CMS and G1), that suggests it
may not be a GC bug, but rather something else is corrupting the heap.

Try to examine the data involved with a debugger (either live or from
a core dump); there might be clues there, especially if there are any
special patterns like 0xdeadbeef and the like involved.

It looks like the bad object was obtained from the mark queue, which
suggests it's either in a GC root or some other object refers to it.
If there's any pattern to the bad value, and you can't find where it's
coming from any other way, you might try instrumenting the path that
scans objects and pushes what they reference onto the mark queue to
look for bad values.




More information about the hotspot-gc-dev mailing list