Reputation: 938
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?
Upvotes: 0
Views: 458
Reputation: 98630
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();
Upvotes: 3