Optimistic Stack Allocation and Dynamic Heapification for Managed Runtimes

Author:

Anand Aditya1ORCID,Adithya Solai2ORCID,Rustagi Swapnil2ORCID,Seth Priyam2ORCID,Sundaresan Vijay3ORCID,Maier Daryl3ORCID,Nandivada V. Krishna4ORCID,Thakur Manas1ORCID

Affiliation:

1. Indian Institute of Technology Bombay, Mumbai, India

2. Indian Institute of Technology Mandi, Mandi, India

3. IBM Canada Lab, Markham, Canada

4. Indian Institute of Technology Madras, Chennai, India

Abstract

The runtimes of managed object-oriented languages such as Java allocate objects on the heap, and rely on automatic garbage collection (GC) techniques for freeing up unused objects. Most such runtimes also consist of just-in-time (JIT) compilers that optimize memory access and GC times by employing escape analysis: an object that does not escape (outlive) its allocating method can be allocated on (and freed up with) the stack frame of the corresponding method. However, in order to minimize the time spent in JIT compilation, the scope of such useful analyses is quite limited, thereby restricting their precision significantly. On the contrary, even though it is feasible to perform precise program analyses statically, it is not possible to use their results in a managed runtime without a closed-world assumption. In this paper, we propose a static+dynamic scheme that allows one to harness the results of a precise static escape analysis for allocating objects on stack, while taking care of both soundness and efficiency concerns in the runtime. Our scheme comprises of three key ideas. First, using the results of a statically performed escape analysis, it performs optimistic stack allocation during JIT compilation. Second, it handles the challenges associated with features that may invalidate the optimism, using a novel idea of dynamic heapification. Third, it uses another novel notion of stack ordering, again supported by a static analysis, to reduce the overheads associated with the checks that determine the need for heapification. The static and the runtime components of our approach are implemented in the Soot optimization framework and in the tiered infrastructure of the Eclipse OpenJ9 VM, respectively. To evaluate the benefits, we compare our scheme with the existing escape analysis and find that it succeeds in allocating a much larger number of objects on the stack. Furthermore, the enhanced stack allocation leads to a significant reduction in the number of GC cycles and brings decent performance improvements, especially suited for constrained-memory environments.

Funder

IBM Canada

Publisher

Association for Computing Machinery (ACM)

Reference25 articles.

1. The Jalapeño virtual machine

2. Aditya Anand Solai Adithya Swapnil Rustagi Priyam Seth Vijay Sundaresan Daryl Maier V. Krishna Nandivada and Manas Thakur. 2024. Artifact of Optimistic Stack Allocation and Dynamic Heapification for Managed Runtimes. https://doi.org/10.5281/zenodo.10804712 10.5281/zenodo.10804712

3. Aditya Anand and Manas Thakur. 2022. Principles of Staged Static+Dynamic Partial Analysis. In Static Analysis Gagandeep Singh and Caterina Urban (Eds.). Springer Nature Switzerland Cham. 44–73. isbn:978-3-031-22308-2 https://doi.org/10.1007/978-3-031-22308-2_4 10.1007/978-3-031-22308-2_4

4. Stephen M. Blackburn, Robin Garner, Chris Hoffmann, Asjad M. Khang, Kathryn S. McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z. Guyer, Martin Hirzel, Antony Hosking, Maria Jump, Han Lee, J. Eliot B. Moss, Aashish Phansalkar, Darko Stefanović, Thomas VanDrunen, Daniel von Dincklage, and Ben Wiedermann. 2006. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications (OOPSLA ’06). ACM, New York, NY, USA. 169–190.

5. Escape analysis for Java TM

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3