简体   繁体   English

有没有办法在 java 中以编程方式确定 JVM CompileThreshold?

[英]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.

相关问题 以编程方式确定Java实例的编译类型 - Programmatically determining the compile-type of a java instance 如果在JVM上设置了-noverify,是否可以通过编程方式进行检查? - Is there any way to programmatically check, if `-noverify` is set on the JVM? 有没有办法以编程方式关闭Java进程但不调用JVM关闭钩子? - Any way to shut down Java process programmatically but not invoke the JVM shutdown hook? 有没有办法确定“主要”是Android还是Java - Is there a way of determining whether the “main” is Android or Java 有没有办法在 Java 中获取集群 JVM 的详细信息 - is there a way to get Cluster JVM's details in Java 以编程方式设置dock:命名Java Mac OS X JVM属性 - Programmatically setting the dock:name Java Mac OS X JVM property 以编程方式确定IOException的原因? - Programmatically determining the cause of IOException? Java中的双向数据绑定(以编程方式) - Two Way DataBinding in Java (Programmatically) CompileThreshold,Tier2CompileThreshold,Tier3CompileThreshold和Tier4CompileThreshold控制什么? - What does CompileThreshold, Tier2CompileThreshold, Tier3CompileThreshold and Tier4CompileThreshold control? 有没有一种确定Java响应是否在200系列中的规范方法? - Is there a canonical way for determining if an HTTP response is in the 200 series in Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM