I’m working with ZGC in Java JDK17, and I’ve been looking into some long-running requests where I can’t figure out where some of the time is going. When I checked the GC logs, I saw that the thread IDs for jit,compilation were from user threads, and the timing lined up with when those slow requests were happening. I’m wondering why jit,compilation is happening on user threads and why it seems to be holding up the user threads.
There is gc log below: 579 is Java-Compiler thread, 4236 is user thread.
[2024-03-27T10:26:37.675+0800][579 ][jit,compilation] 27257 3 java.net.InetAddress::getAllByName (388 bytes) made not entrant
[2024-03-27T10:26:38.572+0800][579 ][jit,compilation] 46702 4 Script_1711505411710_68000::execute0 (112 bytes)
[2024-03-27T10:26:38.576+0800][579 ][jit,compilation] 39531 3 Script_1711505411710_68000::execute0 (112 bytes) made not entrant
[2024-03-27T10:26:38.716+0800][4236][jit,compilation] 42949 ! 4 com.google.common.cache.LocalCache$Segment::get (122 bytes) made not entrant
[2024-03-27T10:26:38.716+0800][4236][jit,compilation] 35244 4 com.google.common.cache.LocalCache::isExpired (57 bytes) made not entrant
[2024-03-27T10:26:38.716+0800][4236][jit,compilation] 28530 4 com.google.common.cache.LocalCache$Segment::recordRead (29 bytes) made not entrant
I did some research and found out that made not entrant means it’s doing JIT deoptimization, I’m wondering if jit deoptimization could take so long? What’s it doing all that time, and how can we avoid it?