Wednesday, September 12, 2012

A Case Study of Using Tiered Compilation in HotSpot

Hotspot has two JITs named c1 (i.e., client JIT) and c2 (i.e., server JIT).[1] The client JIT starts fast but provides less optimizations. So, it is used for GUI application. The server JIT starts more slowly but provide very good optimizations. The idea of tiered compilation [2]is to get the best of both compilers, first JITs the code with c1 and then if the code is really hot to recompile it with c2.

The tiered server runtime is enabled with the following Hotspot VM options:
  • -server -XX:+TieredCompilation
In this article, we show a case study of using HotSpot (build 23.0-b18, mixed mode) with TieredCompilation off/on.


You can tune JVM's performance by tuning either memory management or code generaion.  Here we have tuned code generator by turning tiered compilation mode on.  With tiered compilation on, more classes are compiled (or compiled more efficiently) and so they execute faster (i.e., +15%).

Using ATG CRM Demo benchmark, we saw the following KPI changes:



% Change

Total Footprint




Application Server CPU




Average Response Time





  1. Here is our setting for ReservedCodeCacheSize[2]:
    -TieredCompilation: 128MB
    +TieredCompilation: 256MB
  2. When we turned on tiered compilation mode, we also reserve larger code cache for it (i.e., 256 MB vs. 128 MB).  Code cache is allocated out of native memory (vs. heap).  Total footprint shown in the table includes native memory.  So, we see total footprint is larger when tiered compilation mode is turned on.


  1. HotSpot Glossary of Terms
  2. Performance Tuning with Hotspot VM Option: -XX:+TieredCompilation (Xml and More)


Blogger said...

Did you know you can shorten your links with Shortest and receive cash for every visitor to your short urls.

Blogger said...

BlueHost is ultimately the best website hosting provider with plans for any hosting needs.