Disable JIT byte code recompilation cutoffs in default jvm.config - #4649
Conversation
Setting PerMethodRecompilationCutoff and PerBytecodeRecompilationCutoff to 10000 effectively disables these cutoff limits and JIT always recompiles code on hitting "uncommon-trap". Without this, after hitting these cutoff limits JVM may enter a state where it wastes CPU cycles in "uncommon-trap" handling but taking no action out of it.
I wonder if |
As per the findings in https://groups.google.com/g/presto-users/c/RCVd_UVMW5I/m/3LgcT0RXBQAJ 2500 should be good enough. This issue is hard to repro and we never got to try 2500 after 10000 gave us the improvements. |
|
Do |
|
I'm not sure https://github.com/martint/jittest tests the issue mentioned in doc. doc has a code snipped for testing the issue |
|
|
|
I revisited the notes, the goal of these settings is not to get infinite recompilations but to prevent the JIT state where lot of work is done and no action is taken. These settings would ensure that JIT will not hit the PerMethodRecompilationCutoff or PerBytecodeRecompilationCutoff because of PerMethodTrapLimit=100 (with #traps=25) always hitting first and preventing any more recompilation attempts (with last recompiled version having no uncommon-traps). I will reword the commit accordingly. |
No, that code was to repro a bug in Java 7 related to how the code cache was being managed. It was fixed in Java 8. |
|
@stagraqubole, have you been able to reproduce the problem in Java 11+? |
|
@martint I was able to repro the problem with snipped attached in the doc |
Setting PerMethodRecompilationCutoff and PerBytecodeRecompilationCutoff to 10000
effectively disables these cutoff limits and JIT always recompiles code on hitting
"uncommon-trap". Without this, after hitting these cutoff limits JVM may enter a state
where it wastes CPU cycles in "uncommon-trap" handling but taking no action out of it.
This is based on this work) and we have seen this issue in java8 and these configs helped out.