CompileThreshold,Tier2CompileThreshold,Tier3CompileThreshold和Tier4CompileThreshold控制什么? [英] What does CompileThreshold, Tier2CompileThreshold, Tier3CompileThreshold and Tier4CompileThreshold control?

查看:600
本文介绍了CompileThreshold,Tier2CompileThreshold,Tier3CompileThreshold和Tier4CompileThreshold控制什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HotSpot的分层编译使用解释器,直到调用阈值(对于方法)或迭代(对于循环)触发具有自我分析的客户端编译。使用客户端编译,直到另一个调用或迭代阈值触发服务器编译。

HotSpot's tiered compilation uses the interpreter until a threshold of invocations (for methods) or iterations (for loops) triggers a client compilation with self-profiling. The client compilation is used until another threshold of invocations or iterations triggers a server compilation.

打印HotSpot的标志使用-XX显示以下标志值:+ TieredCompilation。

Printing HotSpot's flags shows the following flag values with -XX:+TieredCompilation.

intx CompileThreshold      = 10000 {pd product}        
intx Tier2CompileThreshold = 0     {product}           
intx Tier3CompileThreshold = 2000  {product}           
intx Tier4CompileThreshold = 15000 {product}           

只有客户端和服务器编译器有太多标志。这些标志控制了哪些编译器?如果不是客户端和服务器,那么附加编译器的目的是什么?

There are too many flags for just a client and server compiler. What compilers are controlled by these flags? If not client and server, what is the purpose of the additional compilers?

在这种情况下是否忽略了CompileThreshold和Tier2CompileThreshold?触发客户端编译时Tier3CompileThreshold控制什么?触发服务器编译时Tier4CompileThreshold控制什么?

Are CompileThreshold and Tier2CompileThreshold ignored in this case? What does Tier3CompileThreshold control when a client compilation is triggered? What does Tier4CompileThreshold control when a server compilation is triggered?

推荐答案

advancedThresholdPolicy.hpp 讨论了不同的编译器层和阈值。请参阅该文件以进行更深入的讨论。

The comments in advancedThresholdPolicy.hpp discuss the different compiler tiers and the thresholds. See that file for a deeper discussion.

系统支持5个执行级别:

The system supports 5 execution levels:


  • 第0层 - 解释器

  • 第1层 - 完全优化的C1(无分析)

  • 第2层 - 带调用和备份计数器的C1

  • 第3层 - 具有完整性能分析的C1(2级+ MDO)

  • 第4层 - C2

  • Tier 0 - interpreter
  • Tier 1 - C1 with full optimization (no profiling)
  • Tier 2 - C1 with invocation and backedge counters
  • Tier 3 - C1 with full profiling (level 2 + MDO)
  • Tier 4 - C2

C1是客户端编译器。 C2是服务器编译器。

C1 is the client compiler. C2 is the server compiler.

在常见情况下,编译为:0→3→4。根据C1和C2队列长度使用非典型情况。当C2队列长度太长时使用第2层,以便该方法可以执行约30%的速度,直到C2可以处理分析信息。如果确定该方法是微不足道的,那么它将使用第1层编译,因为它将生成与第4层相同的代码。

In the common case, the compilation goes: 0 → 3 → 4. Atypical cases are used based on C1 and C2 queue lengths. Tier 2 is used when the C2 queue length is too long so that the method can execute about 30% faster until the C2 can process the profiling information. If the method is determined to be trivial, then it is compiled with Tier 1 since it will produce the same code as Tier 4.

阈值是根据长度动态调整的C1和C2队列。

Thresholds are dynamically adjusted based on the length of the C1 and C2 queues.

这篇关于CompileThreshold,Tier2CompileThreshold,Tier3CompileThreshold和Tier4CompileThreshold控制什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆