1, I want to know how much time spent on compile a class or method in hotspot during JIT (We got some timeout issue and we suspect it maybe caused by a long compilation time)? Is there any trace flag or other ways to trace this time?
2,BTW, if the method run on first time , then the compilation time would is 0 as there is totally no compilation process, right?
JVM flags: -XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintCompilation2
289 425 4 java.time.LocalDate::until (116 bytes)
292 360 3 java.time.ZoneId::of (85 bytes) made not entrant
293 426 4 java.time.LocalDate::from (68 bytes)
293 386 3 java.time.LocalDate::from (68 bytes) made not entrant
293 426 size: 248(96) time: 0 inlined: 54 bytes
297 425 size: 3688(2272) time: 8 inlined: 1092 bytes
^ ^ ^ ^ ^
| | | | |
| | compiled bytes | bytecodes inlined
| compilation ID method compilation time (ms)
timestamp (ms from JVM start)
Note that
PrintCompilation
output may appear interleaved.