arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.10219cs.PL
收藏

老即是金:使用 Exgen-Malloc 优化单线程应用

Old is Gold: Optimizing Single-threaded Applications with Exgen-Malloc

The University of Texas at Austin(德克萨斯大学奥斯汀分校)

Ruihao Li, Lizy K. John, Neeraja J. Yadwadkar

AI总结:

本文提出了专为单线程应用设计的内存分配器 Exgen-Malloc,通过消除不必要元数据和简化控制流来降低开销,在多项基准测试中相比 dlmalloc 和 mimalloc 实现了显著的性能提升与内存节省。

摘要:

内存分配器隐藏在几乎每个应用程序栈之下,但其性能足迹远超其代码大小。分配器中即使很小的低效也会在缓存和内存层次结构的其余部分产生连锁反应,共同施加了运营商通常所称的“数据中心税”。在超大规模环境中,分配器效率即使提高1%也能节省数百万美元,并显著降低数据中心的能耗。现代内存分配器旨在优化多线程环境下的分配速度和内存碎片,依赖复杂的元数据和控制逻辑来实现高性能。然而,这种复杂性引入的开销促使人们重新评估分配器设计。值得注意的是,在单线程场景中可以避免此类开销,而单线程场景在各类应用领域仍被广泛使用。在本文中,我们介绍了 Exgen-Malloc,这是一种专为单线程应用打造的内存分配器。通过针对单线程执行进行专门化,Exgen-Malloc 消除了不必要的元数据,简化了控制流,从而减少了开销并提高了分配效率。其核心设计特征包括集中式堆、单一空闲块列表,以及内存提交与重定位的平衡策略。此外,Exgen-Malloc 融入了现代多线程分配器中的设计原则,而这些原则在诸如 dlmalloc 等传统单线程分配器中是不存在的。我们在两个 Intel Xeon 平台上对 Exgen-Malloc 进行了评估。在这两个系统上,Exgen-Malloc 在 SPEC CPU2017、redis-benchmark 和 mimalloc-bench 上分别比 dlmalloc 实现了 1.17 倍、1.10 倍和 1.93 倍的加速。除了性能之外,Exgen-Malloc 在 SPEC CPU2017、redis-benchmark 和 mimalloc-bench 上分别比 mimalloc 节省了 6.2%、0.1% 和 25.2% 的内存。

英文摘要:

Memory allocators hide beneath nearly every application stack, yet their performance footprint extends far beyond their code size. Even small inefficiencies in the allocators ripple through caches and the rest of the memory hierarchy, collectively imposing what operators often call a "datacenter tax". At hyperscale, even a 1% improvement in allocator efficiency can unlock millions of dollars in savings and measurable reductions in datacenter energy consumption. Modern memory allocators are designed to optimize allocation speed and memory fragmentation in multi-threaded environments, relying on complex metadata and control logic to achieve high performance. However, the overhead introduced by this complexity prompts a reevaluation of allocator design. Notably, such overhead can be avoided in single-threaded scenarios, which continue to be widely used across diverse application domains. In this paper, we introduce Exgen-Malloc, a memory allocator purpose-built for single-threaded applications. By specializing for single-threaded execution, Exgen-Malloc eliminates unnecessary metadata, simplifies the control flow, thereby reducing overhead and improving allocation efficiency. Its core design features include a centralized heap, a single free-block list, and a balanced strategy for memory commitment and relocation. Additionally, Exgen-Malloc incorporates design principles in modern multi-threaded allocators, which do not exist in legacy single-threaded allocators such as dlmalloc. We evaluate Exgen-Malloc on two Intel Xeon platforms. Across both systems, Exgen-Malloc achieves a speedup of 1.17x, 1.10x, and 1.93x over dlmalloc on SPEC CPU2017, redis-benchmark, and mimalloc-bench, respectively. In addition to performance, Exgen-Malloc achieves 6.2%, 0.1%, and 25.2% memory savings over mimalloc on SPEC CPU2017, redis-benchmark, and mimalloc-bench, respectively.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑