We can determine the compile threshold using these jvm flags -XX:+PrintFlagsFinal -XX:+PrintFlagsInitial
, but is there a way of determining it programmatically at runtime?
Asked
Active
Viewed 290 times
0

Dev2017
- 857
- 9
- 31
1 Answers
2
Yes, you can get the value, though it is absolutely useless.
With Tiered Compilation (defaut), this flag is meaningless.
Here is how to get a value of any HotSpot VM flag:
HotSpotDiagnosticMXBean mbean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
String value = mbean.getVMOption("CompileThreshold").getValue();

apangin
- 92,924
- 10
- 193
- 247