The Cost of Profiling in the HotSpot Virtual Machine
Modern language runtimes use just-in-time compilation to execute applications natively. Typically, multiple compiler tiers cooperate so that compilation at a later stage can leverage profiling information generated by earlier tiers. This allows for machine code that is optimized to the actual workload and hardware. In this work, we study the profiling overhead caused by code instrumentation in the HotSpot Java virtual machine for 23 applications from the Renaissance suite and five additional benchmarks. Our study confirms two common assumptions. First, most applications move quickly through the profiling phase. However, we also show applications that tier up surprisingly slowly and, thus, are more affected by profiling overheads. We find that the instrumentation needed for profiling can slow application execution down by up to 35×. A key factor is the memory contention on the shared profiling data structures in multi-threaded applications. Second, most virtual call sites are monomorphic, i.e., they only have a single receiver type. This can reduce the run-time cost of otherwise expensive receiver type profiling at virtual call sites. Our analysis suggests that, for the most part, profiling overhead in language runtimes is not a cause for concern. However, we show that there are situations, e.g., in multi-threaded applications, where profiling impact can be consequential.
Authors
- Rene Mueller (ORCID: https://orcid.org/0000-0001-6084-9944)
- Konstantinos Tovletoglou (ORCID: https://orcid.org/0000-0002-1513-3143)
- Maria Carpen-Amarie (ORCID: https://orcid.org/0009-0008-5676-1649)
- Matvii Aslandukov
Institutions
- Kharkiv National University of Radio Electronics (UA)
- Institute for Independent Studies Zürich (CH)
Publication Details
- Published
- 2024-09-13
- DOI
- https://doi.org/10.1145/3679007.3685055
- Primary Topic
- Cloud Computing and Resource Management
- Type
- article
- Field-Weighted Citation Impact
- 0.00