[英]Is there a way of determining JVM CompileThreshold programmatically in java?
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?我们可以使用这些 jvm 标志
-XX:+PrintFlagsFinal -XX:+PrintFlagsInitial
来确定编译阈值,但是有没有办法在运行时以编程方式确定它?
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:以下是如何获取任何 HotSpot VM 标志的值:
HotSpotDiagnosticMXBean mbean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
String value = mbean.getVMOption("CompileThreshold").getValue();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.