简体   繁体   中英

JVM hangs after migrating to jdk1.8.0_74

I have a java application which used to run fine with java 7. After migrating to java 8 with the following confiugration it started to hang.

-Xms3g -Xmx3g -verbose:gc -XX:+UseG1GC -XX:G1ReservePercent=25 -XX:+PrintGCDateStamps

I have taken jstack dump and it shows that all threads are in BLOCKED state. I also have taken jmap dump which shows the following information.

Can someone help me in resolving this issue?

Attaching to process ID 2554, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.74-b02

using thread-local object allocation.
Garbage-First (G1) GC with 18 thread(s)

Heap Configuration:
   MinHeapFreeRatio         = 40
   MaxHeapFreeRatio         = 70
   MaxHeapSize              = 3221225472 (3072.0MB)
   NewSize                  = 1363144 (1.2999954223632812MB)
   MaxNewSize               = 1932525568 (1843.0MB)
   OldSize                  = 5452592 (5.1999969482421875MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 1048576 (1.0MB)

Heap Usage:
G1 Heap:
   regions  = 3072
   capacity = 3221225472 (3072.0MB)
   used     = 2112667712 (2014.7969360351562MB)
   free     = 1108557760 (1057.2030639648438MB)
   65.58583776156108% used
G1 Young Generation:
Eden Space:
   regions  = 1665
   capacity = 2024800256 (1931.0MB)
   used     = 1745879040 (1665.0MB)
   free     = 278921216 (266.0MB)
   86.22475401346452% used
Survivor Space:
   regions  = 5
   capacity = 5242880 (5.0MB)
   used     = 5242880 (5.0MB)
   free     = 0 (0.0MB)
   100.0% used
G1 Old Generation:
   regions  = 349
   capacity = 1191182336 (1136.0MB)
   used     = 361545792 (344.79693603515625MB)
   free     = 829636544 (791.2030639648438MB)
   30.351842960841218% used

18753 interned Strings occupying 1751224 bytes.

You need to take a thread dump and analyze it carefully to understand where they are stuck, it is most likely thread safety issue in your code. We have faced similar locking issue in the past when we moved from Linux 4 machine to Linux 6 (much powerful machine with multiple CPU and cores). Faster machines can expose such long standing threading related programming bugs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM