系统与数据库2019arxiv.org
Mesh:面向 C/C++ 应用的紧凑内存管理
Mesh: Compacting Memory Management for C/C++ Applications
进阶 · 约 60 分钟读完前置知识:虚拟内存与分页、C/C++ 内存分配器、内存碎片与压缩基础
导读
Mesh 研究如何为 C/C++ 应用实现堆内存压缩,以降低内存占用,且不要求程序改动。其核心思路是结合随机化分配和虚拟内存映射,在对象本身不移动的情况下回收稀疏使用的物理页;论文报告了在真实应用上的内存节省效果。
HN 关注点:作为可直接替换 malloc 的实用内存压缩方案,并讨论其数据结构、与 Rust/Go 运行时的集成方式以及相关理论背景。
HN 评论精选
这几条评论里:质疑 2 补充 2
质疑认为 shuffle vector 虽新颖但概念简单,本质是带 Fisher-Yates 洗牌的 vector。
shuffle vector 是新的数据结构吗?我以前没见过,但它看起来太显然了:我还没读到描述,只看图三就明白它怎么工作了——基本上就是一个内置 Fisher-Yates 洗牌算法的 vector!不知道它还有哪些别的用途。
vanderZwan查看英文原文
Is the shuffle vector a novel data structure? I've never seen it before but it looks so obvious that just glancing at figure three was enough to figure out how it worked before I got to the description: it's basically a vector with a Fisher-Yates[0] shuffle built in! I wonder what other uses they might have. [0] https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
质疑质疑论文所说未来集成 Rust 的必要性,指出可通过 LD_PRELOAD 或 GlobalAlloc 接入。
关于 Rust:既然 Rust 现在默认使用系统分配器,难道不能直接通过 LD_PRELOAD 之类的方式使用 Mesh 吗?当然,也可以提供一个正式的 GlobalAlloc 实现(最终是 Alloc)。
masklinn查看英文原文
> In future work, we plan to explore integrating Mesh into language runtimes that do not currently support compaction, such as Go and Rust. With respect to Rust, isn't it usable as-is through LD_PRELOAD or whatnot since Rust now uses the system allocator by default? Though obviously a proper GlobalAlloc implementation could be provided (and eventually an Alloc).
补充希望获得内存管理领域关键理论结果(如 Robson bounds)的清单。
有人有内存管理领域最重要成果的清单吗?我以前没听说过 Robson bounds,但它似乎很关键,我一直在找这类结果。还有别的类似结论吗?
mehrdadn查看英文原文
Does anyone have some kind of list of the most important results in the area of memory management? I'd never heard of the Robson bounds but they seem quite crucial to know about, and I'd always been looking for something like them. Are there other such results?
补充提供 Mesh 的开源代码链接。
如果有人感兴趣,源代码在这里:https://github.com/plasma-umass/Mesh
lefty2查看英文原文
Source code is available here in case anyone's interested: https://github.com/plasma-umass/Mesh
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2019Hacker News 讨论帖167 分 · 36 评
同领域还值得读
I/O 比 CPU 更快——让我们划分资源并消除操作系统抽象
I/O Is Faster Than CPU – Let’s Partition Resources and Eliminate OS Abstractions
指出在现代服务器硬件上 I/O 速度已接近甚至超过 CPU,传统操作系统抽象反而成为瓶颈。
系统与数据库2019 · 817 分 · 277 评进阶 · 约 30 分钟编辑精选使用 io_uring 的高效 I/O
Efficient IO with io_uring
由 Linux 内核开发者 Jens Axboe 撰写,介绍 Linux 新的异步 I/O 接口 io_uring。
系统与数据库2019 · 426 分 · 96 评进阶 · 约 45 分钟编辑精选线程对大多数用途而言是个坏主意(1995)
Threads Are a Bad Idea for Most Purposes (1995)
这篇 1995 年的文章由 John Ousterhout 撰写,讨论为什么线程对大多数用途而言是坏主意,并主张事件驱动编程通常更简单、更高效。
系统与数据库2017 · 423 分 · 382 评进阶 · 约 25 分钟编辑精选学习型索引结构之论证
The Case for Learned Index Structures
提出把索引看作一种"模型":既然 B-tree 等结构本质上是在学习数据的分布,就可以用机器学习模型(如回归模型、神经网络)来近似键到位置的映射,从而替代 B-tree、哈希索引…
系统与数据库2017 · 398 分 · 66 评 · 引用 25进阶 · 约 60 分钟编辑精选FoundationDB:一个分布式、解耦的事务型键值存储
FoundationDB: A distributed, unbundled, transactional key value store
介绍 FoundationDB:一个分布式、解耦设计的事务性键值存储。
系统与数据库2021 · 283 分 · 99 评进阶 · 约 90 分钟编辑精选