paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Heap-Snapshot Matching and Ordering using CAHPs: A Context-Augmented Heap-Path Representation for Exact and Partial Path Matching using Prefix Trees

使用 CAHP 的堆快照匹配与排序:一种基于前缀树的上下文增强堆路径表示,用于精确与部分路径匹配
OOPSLA 9(OOPSLA2)2025匹配度 2/10 · 该论文聚焦 GraalVM Native Image 的堆快照对象匹配与重排序,属于编译优化与运行时内存管理,与用户关注的静态分析、LLM/Agent、浮点程序分析、贝叶斯程序分析等核心方向无直接关联。尽管涉及程序表示与匹配技术,但并非用户研究画像中的核心问题。引用 0 inbox
Matteo Basso, Aleksandar Prokopec, Andrea Rosà, Walter Binder
crossref: 2026-09-10

AI 速览

一句话:提出上下文增强堆路径 CAHP 与前缀树匹配方法,改进 Native Image 堆快照对象映射并重排以减少页错误、加速启动。

GraalVM Native Image 通过 AOT 编译生成包含预初始化堆快照的二进制以优化启动,但访问堆快照对象会产生页错误;已有 profile-guided 重排依赖跨 binary 匹配语义等价对象,而对象无唯一身份且快照内容不持久,匹配困难。本文提出 CAHP(上下文增强堆路径),为对象关联尽可能唯一的路径表示;相同 CAHP 视为语义等价;对因非确定性等导致无法匹配的 CAHP,在插桩与优化二进制间寻找最相似 CAHP 进行部分匹配。该方法集成到 Native Image,用改进映射重排堆快照对象。评估显示页错误平均减少 2.98×,启动时间平均提升 1.98×。

问题
Native Image 堆快照对象无唯一身份且跨构建不持久,导致 profile-guided 重排难以在插桩与优化二进制间匹配语义等价对象,页错误拖累启动性能。
方法
提出 CAHP 表示每个对象的上下文增强堆路径,用前缀树做精确匹配,并对未匹配 CAHP 做最相似部分匹配,进而重排堆快照对象。
评估
集成到 GraalVM Native Image,在真实应用中测量页错误与启动时间;相对原始 Native Image,页错误平均减少 2.98×,启动时间平均提升 1.98×。
原文摘要(Abstract)

GraalVM Native Image is increasingly used to optimize the startup performance of applications that run on the Java Virtual Machine (JVM), and particularly of Function-as-a-Service and Serverless workloads. Native Image resorts to Ahead-of-Time (AOT) compilation to produce a binary from a JVM application that contains a snapshot of the pre-initialized heap memory, reducing the initialization time and hence improving startup performance. However, this performance improvement is hindered by page faults that occur when accessing objects in the heap snapshot. Related work has proposed profile-guided approaches to reduce page faults by reordering objects in the heap snapshot of an optimized binary based on the order in which objects are first accessed, obtaining this information by profiling an instrumented binary of the same application. This reordering is effective only if objects in the instrumented binary can be matched to the semantically equivalent ones in the optimized binary. Unfortunately, this is very challenging because objects do not have unique identities and the heap-snapshot contents are not persistent across Native-Image builds of the same program. This work tackles the problem of matching heap snapshots, and proposes a novel approach to improve the mapping between semantically equivalent objects in different binaries of a Native-Image application. We introduce the concept of context-augmented heap path (CAHP) —a list of elements that describes a path to an object stored in the heap snapshot. Our approach associates a CAHP to each object in a way that is as unique as possible. Objects with the same CAHP across different binaries are considered semantically equivalent. Moreover, since some semantically equivalent objects may have different CAHPs in the instrumented and optimized binaries (due to nondeterminism in the image-build process and other factors), we present an approach that finds, for each unmatched CAHP in the optimized binary, the most similar CAHP in the instrumented binary, associating the two objects. We integrate our approach into Native Image, reordering the objects stored in the heap snapshot more efficiently using the improved mapping. Our experiments show that our approach leads to much less page faults (2.98× on average) and considerably improves startup time (1.98× on average) w.r.t. the original Native-Image implementation.

链接与引用

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

BibTeX
@article{paperbot2994,
  title = {Heap-Snapshot Matching and Ordering using CAHPs: A Context-Augmented Heap-Path Representation for Exact and Partial Path Matching using Prefix Trees},
  author = {Matteo Basso and Aleksandar Prokopec and Andrea Rosà and Walter Binder},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763103}
}