Java Crash in GCTaskThread
Environment
- Oracle JDK
- OpenJDK
Issue
- JVM crashes with the current thread GCTaskThread:
Current thread (0x000000004013c5c0): GCTaskThread [id=22820]
Resolution
- A workaround may be to try a different collector (e.g. throughput, G1) or improve garbage collection performance.
- Upgrade to the latest OpenJDK, OracleJDK.
- If OracleJDK, open a support case with Oracle support to rigorously troubleshoot this.
Root Cause
Known causes:
- Crash in GCTaskThread in native code after migrating to OpenJDK 8
- Java crash in GCTaskThread on OpenJDK8 with G1 collector
- JVM crash in oopDesc::size_given_klass with current thread GCTaskThread
- JVM crash during Concurrent Mark Sweep minor collection
- JVM is crashing in the CMS collector after moving to Java 7
- JVM crashed by SIGSEGV(SEGV_ACCERR) and core dumped
- Java crash in GCTaskThread with Shenandoah collector
- Crash in GCTaskThread after migrating to OpenJDK 1.8
- Java crash on Sun/Oracle JDK with both survivor spaces occupied or empty
- JVM crash due to corrupted ParBitMap on RHEL OpenJDK
Diagnostic Steps
- Analyze the fatal error log:
- What collector is doing concurrent marking when the crash happens?
- Check the size of the objects in the "from" and "to" spaces in the fatal error log at the time of the crash. Normally one survivor space is always 0, but with this issue both survivor spaces are populated. During a young collection, first the live objects in the eden space are copied to the 2nd survivor space, then the live objects from the 1st survivor space are copied to the 2nd survivor space, resulting in the 1st survivor space being empty. Because the crash happens when live objects from the eden space are copied to the 2nd survivor space, both the "from" (1st survivor space) and "to" (2nd survivor space) contain objects.
- Enable garbage collection logging and analyze performance:
Product(s)
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.