paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Getting a Handle on Unmanaged Memory

掌握非托管内存:引入句柄
ASPLOS Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 32024匹配度 1/10 · 该论文研究不可移动非托管堆对象的内存管理与编译器/运行时支持,属于 PL 中的运行时与编译方向;但未涉及 LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析,与用户研究画像的核心交叉方向基本无关。引用 5 inbox
Nick Wanninger, Tommy McMichen, Simone Campanoni, Peter Dinda
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 Alaska 编译器与运行时,用句柄为不可移动的非托管堆对象增加间接层,实现无需修改代码的压缩式内存管理。

非托管语言通常无法移动堆对象,导致内存碎片长期困扰数据库、Web 服务器等应用,而托管语言依靠压缩式 GC 解决该问题。本文引入句柄这一间接层,使非托管语言中的堆对象也可被移动,从而在既有未修改代码中直接使用托管运行时特性。作者实现 Alaska:作为 malloc 的 drop-in 替代,编译器自动把基于指针的代码转换为使用句柄,并通过优化降低开销;配套运行时管理该间接层,并通过可扩展服务接口利用对象移动。评估覆盖多个领域的大型基准与应用,测量开销,并用 Alaska 对 Redis 堆去碎片化,最高减少 40% 内存占用。

问题
非托管语言无法移动堆对象,内存碎片难以消除;现有方案要么忍受碎片,要么需逐应用进行大量手工改造。
方法
通过句柄增加间接层,让堆对象可移动;Alaska 编译器自动将指针代码转为句柄代码,运行时以 malloc 替代品管理句柄并提供可扩展服务接口。
评估
在跨领域大型基准与应用上测量性能开销,并用 Redis 的去碎片化验证可扩展性,内存占用最多降低 40%。
原文摘要(Abstract)

The inability to relocate objects in unmanaged languages brings with it a menagerie of problems. Perhaps the most impactful is memory fragmentation, which has long plagued applications such as databases and web servers. These issues either fester or require Herculean programmer effort to address on a per-application basis because, in general, heap objects cannot be moved in unmanaged languages. In contrast, managed languages like C# cleanly address fragmentation through the use of compacting garbage collection techniques built upon heap object movement. In this work, we bridge this gap between unmanaged and managed languages through the use of handles, a level of indirection allowing heap object movement. Handles open the door to seamlessly employing runtime features from managed languages in existing, unmodified code written in unmanaged languages. We describe a new compiler and runtime system, Alaska, that acts as a drop-in replacement for malloc. Without any programmer effort, the Alaska compiler transforms pointer-based code to utilize handles, with optimizations to minimize performance impact. A codesigned runtime system manages this new level of indirection and exploits heap object movement via an extensible service interface. We investigate the overheads of Alaska on large benchmarks and applications spanning multiple domains. To show the power and extensibility of handles, we use Alaska to eliminate fragmentation on the heap through defragmentation, reducing memory usage by up to 40% in Redis.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{WanningerMCD24,
  title = {Getting a Handle on Unmanaged Memory},
  author = {Nick Wanninger and Tommy McMichen and Simone Campanoni and Peter Dinda},
  booktitle = {ASPLOS},
  year = {2024},
  doi = {10.1145/3620666.3651326}
}