• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学

• 高性能计算 • 上一篇    下一篇

一种基于Java虚拟机的动静结合自适应优化方法

张海军1,郑艳2,叶俊1,白书敬1   

  1. (1.江南计算技术研究所,江苏 无锡 214083; 2.无锡城市职业技术学院,江苏 无锡 214073)
  • 收稿日期:2018-10-15 修回日期:2018-12-21 出版日期:2019-06-25 发布日期:2019-06-25

A static and dynamic adaptive optimization
 method based on Java virtual machine

ZHANG Haijun1,ZHENG Yan2,YE Jun1,BAI Shujing1   

  1. (1.Jiangnan Institute of Computing Technology,Wuxi 214083;
    2.Wuxi City College of Vocational Technology,Wuxi  214073,China)
     
  • Received:2018-10-15 Revised:2018-12-21 Online:2019-06-25 Published:2019-06-25

摘要:

动态语言可以利用程序运行时获取的动态信息,指导程序进行各种优化。但是,现有的Java虚拟机没有将运行过程中收集的信息有效利用,而是在运行结束后直接丢弃,下一次执行程序的时候重新监测、收集、优化需要的信息。基于HotSpot虚拟机提出一种动静结合的自适应优化方法,将运行过程中优化对象迭代搜索到的最佳参数或者信息保存到资源库中;能够从资源库中学习获得适合当前程序的最佳参数或选项,可有效地利用运行过程中积累的数据;资源分析是静态且离线的,不占用应用程序运行的开销;迭代学习的过程中,通过避免冗余实例入库以及从库中剔除噪声实例,保证资源库学习过程的精度与效率。实验表明,该框架对指导Java虚拟机在不同的平台上自适应优化具有一定的实用性。
 
 

关键词: Java虚拟机, 自适应优化, 迭代编译, 实例学习, 资源库

Abstract:

Dynamic language can take advantage of the profiling information at runtime to guide various optimizations of the program. However, the existing JAVA virtual machine does not effectively utilize the information collected at runtime, and directly discards it at the end. It re-monitors and collects the information needed for optimization when the program is executed again. We therefore propose a static and dynamic adaptive optimization method based on HotSpot virtual machine, which saves the optimal parameters or information obtained by the optimized object iterative search at runtime into the resource library. It can learn from the resource library to obtain the best parameters or options suitable for the current program, and effectively use the data accumulated at runtime. Resource analysis is static and offline, and does not take up the overhead for running the application. In the process of iterative learning, the accuracy and efficiency of the resource library learning process are ensured by avoiding redundancy instances to enter the library and removing noise instances from the library. Experiments show that the proposal is practical in guiding the adaptive optimization for Java virtual machine on different platforms.
 

Key words: Java virtual machine, adaptive optimization, iterative compilation;instance learning, resource library