paperbot · PL 论文追踪

全部论文 待读 收藏

P2 OJXPerf

OJXPerf:面向托管语言重复对象的内存膨胀剖析器
ICSE Proceedings of the 44th International Conference on Software Engineering2022匹配度 1/10 · 该论文聚焦 Java 程序运行时内存膨胀的采样剖析与对象去重优化,属于运行时/性能工程方向,与用户关注的静态分析、LLM/Agent、浮点程序分析及贝叶斯程序分析均无直接关联。引用 12 inbox
Bolun Li, Hao Xu, Qidong Zhao, Pengfei Su, Milind Chabbi, Shuyin Jiao, Xu Liu
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出轻量采样剖析器 OJXPerf,借助硬件 PMU 与调试寄存器概率性识别同类型重复对象,指导 Java 程序消除内存膨胀。

内存膨胀是 Java 等托管语言复杂生产软件中低效的重要来源。已有方法多关注超出生命周期的对象,却很少研究同类型对象之间在多大程度上是完全相同的。本文提出 OJXPerf,一个轻量级采样剖析器,它概率性地识别重复对象:利用硬件性能监控单元(PMU)与硬件调试寄存器,对在同一调用上下文分配、但可能在不同程序点访问的同类型对象的字段值进行采样比较,最终给出按重复频率排序的对象分配上下文与使用上下文组合。这类重复对象相对更容易优化,开发者可据此重构代码以复用已有对象,从而降低内存压力、减少分配与垃圾回收、提升数据局部性并避免重复计算。OJXPerf 平均仅带来 9% 的运行时开销和 6% 的内存开销。作者用其剖析结果指导多个知名基准与真实 Java 应用的优化,测得内存占用最多降低 11%、性能最多提升 25%,实证了该工具的有效性。

问题
托管语言(如 Java)中大量同类型对象可能在字段值上完全相同,造成内存膨胀、冗余分配与重复计算,而现有工作主要关注对象存活期过长,缺乏对同类型对象重复程度及其代码级归因的量化手段。
方法
设计采样式剖析器 OJXPerf,结合硬件性能监控单元(PMU)与硬件调试寄存器,对同一分配调用上下文下分配、可能在不同程序点访问的同类型对象的字段值进行概率采样与比较,输出按重复频率排序的分配上下文与使用上下文组合。
评估
在多个 Java 基准与真实应用上测量剖析开销,平均为 9% 运行时和 6% 内存开销;再利用剖析结果指导代码优化,实现最多 11% 的内存占用下降与最多 25% 的加速。
原文摘要(Abstract)

Memory bloat is an important source of inefficiency in complex production software, especially in software written in managed languages such as Java. Prior approaches to this problem have focused on identifying objects that outlive their life span. Few studies have, however, looked into whether and to what extent myriad objects of the same type are identical. A quantitative assessment of identical objects with code-level attribution can assist developers in refactoring code to eliminate object bloat, and favor reuse of existing object(s). The result is reduced memory pressure, reduced allocation and garbage collection, enhanced data locality, and reduced re-computation, all of which result in superior performance. We develop OJXPerf, a lightweight sampling-based profiler, which probabilistically identifies identical objects. OJXPerf employs hardware performance monitoring units (PMU) in conjunction with hardware debug registers to sample and compare field values of different objects of the same type allocated at the same calling context but potentially accessed at different program points. The result is a lightweight measurement – a combination of object allocation contexts and usage contexts ordered by duplication frequency. This class of duplicated objects is relatively easier to optimize. OJXPerf incurs 9% runtime and 6% memory overheads on average. We empirically show the benefit of OJXPerf by using its profiles to instruct us to optimize a number of Java programs, including well-known benchmarks and real-world applications. The results show a noticeable reduction in memory usage (up to 11%) and a significant speedup (up to 25%).

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2203-12712,
  title = {OJXPerf},
  author = {Bolun Li and Hao Xu and Qidong Zhao and Pengfei Su and Milind Chabbi and Shuyin Jiao and Xu Liu},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510083}
}