paperbot · PL 论文追踪

全部论文 待读 收藏

P2 FlexHeap: Dynamic I/O-Aware Heap Resizing for Managed Applications

FlexHeap:面向托管应用的动态 I/O 感知堆大小调整
PLDI 10(PLDI)2026匹配度 1/10 · 该论文属于 JVM 运行时/内存管理/G C 与 I/O 调度方向,解决堆与页缓存的 DRAM 划分问题;与用户关注的静态分析、LLM/Agent 交叉、浮点程序分析、贝叶斯程序分析等核心方向无直接关联。引用 0 inbox
Iacovos G. Kolokasis, Shoaib Akram, Foivos S. Zakkak, Polyvios Pratikakis, Angelos Bilas
crossref: 2026-09-10

AI 速览

一句话:提出 FlexHeap,在 JVM 堆与 I/O 页缓存间动态划分 DRAM 预算,权衡 GC 与 I/O 停顿以提升搜索分析应用性能。

基于 JVM 的搜索与分析系统依赖 OS 页缓存加速存储访问,但 DRAM 在 JVM 堆与 I/O 缓存间的划分存在权衡:堆越大 GC 开销越低却挤占 I/O 缓存,堆越小 I/O 越快但 GC 成本上升。现有堆调整机制忽略 I/O,无法处理该权衡。FlexHeap 为 OpenJDK 默认 G1 回收器动态划分固定 DRAM 预算:以 G1 收集边界为决策时机,用历史方法估计未来区间 GC 与 I/O 停顿的 CPU 时间损失,并采用随综合成本变化的自适应步长。在 OpenJDK 21 中实现,Elasticsearch 平均提升 30%,Spark 平均提升 33%,比 Vertical G1 吞吐平均高 50%。

问题
现有 JVM 堆大小调整机制忽略 I/O 页缓存的收益,无法在堆与 I/O 缓存之间做出权衡;扩大堆可降低 GC 开销但会饿死 I/O 缓存,缩小堆则相反。
方法
FlexHeap 在 G1 的收集边界处做调整决策,利用历史数据估计未来区间内 GC 与 I/O 停顿的 CPU 时间成本,并采用随综合成本变化的自适应步长重新划分固定 DRAM 预算。
评估
在 OpenJDK 21 的 G1 垃圾回收器中实现,并以 Elasticsearch 和 Spark 进行评估;相比 G1 堆调整机制平均提升 30% 和 33%,相比 Vertical G1 吞吐平均提升 50%。
原文摘要(Abstract)

Popular JVM-based search and analytics systems, such as Elasticsearch and Spark, rely on the OS page cache (I/O cache) to accelerate storage access. However, dividing memory between the JVM heap and the I/O cache creates a trade-off: enlarging the heap reduces garbage collection (GC) overhead but starves the I/O cache, while shrinking it improves I/O performance but raises GC cost. Existing heap resizing mechanisms ignore I/O and thus fail to address this trade-off, resulting in inefficient memory utilization and degraded performance. In this paper, we propose FlexHeap, a heap resizing mechanism for Garbage First (G1), the default OpenJDK garbage collector, that dynamically partitions a fixed DRAM budget between the JVM heap and the I/O cache. Between GC intervals, it estimates the CPU time lost to GC and to I/O stalls and repartitions DRAM to reduce their combined cost. FlexHeap relies on three concepts: (1) It makes resizing decisions using G1 collection boundaries. (2) It uses a history-based approach to estimate the cost of GC and I/O stalls for the future intervals. (3) It uses an adaptive resizing step that scales with changes in the combined cost. We implement FlexHeap in OpenJDK 21’s G1 garbage collector and evaluate it on two widely used systems: the Elasticsearch search engine and the Spark analytic framework. Compared to the G1 heap resizing mechanism, FlexHeap improves performance by an average of 30% in Elasticsearch and by an average of 33% in Spark. It outperforms Vertical G1, a state-of-the-art enhancement to the default G1 heap resizing mechanism, that returns unused memory to the OS eagerly, by 50% on average in throughput, demonstrating that JVM heap resizing needs to consider I/O overhead in search and analytics applications.

链接与引用

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

BibTeX
@article{paperbot3774,
  title = {FlexHeap: Dynamic I/O-Aware Heap Resizing for Managed Applications},
  author = {Iacovos G. Kolokasis and Shoaib Akram and Foivos S. Zakkak and Polyvios Pratikakis and Angelos Bilas},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {PLDI},
  year = {2026},
  doi = {10.1145/3808247}
}