The Garbage Collection Handbook: The Art of Automatic Memory Management (2nd Ed)
The Garbage Collection Handbook: The Art of Automatic Memory Management (2nd Ed)
Comprehensive Guide to Modern Automatic Memory Management
The Garbage Collection Handbook: The Art of Automatic Memory Management (2nd Ed) 是一个权威的参考资料,它综合了自动内存管理领域六十年的研究与开发成果。它更新了 1996 年和 2012 年版本的奠基性知识,以应对现代硬件和软件环境带来的复杂性。
Key Updates and New Content in the Second Edition
2023 年的第二版在之前版本的基础上进行了扩展,涵盖了高性能计算和内存管理不断演变的格局。
Expanded Scope and New Chapters
- Increased Volume: 第二版增加了超过 90 页的内容。
- New Specialized Topics: 本书引入了专注于持久化(persistence)和能源感知型垃圾回收(energy-aware garbage collection)的新章节,反映了现代在数据持久性和功耗效率方面的优先级。
- Modern Collector Analysis: 对当代、高性能的商业垃圾回收器进行了详细讨论。
Advanced Algorithm Coverage
除了传统的和简单的算法之外,手册还全面覆盖了:
- Parallel Garbage Collection: 利用多个处理器来减少停顿时间。
- Concurrent Garbage Collection: 在应用程序继续运行时执行回收任务。
- Incremental Garbage Collection: 将回收过程分解为较小的块以避免长时间停顿。
- Real-time Garbage Collection: 为时间关键型系统确保确定性的停顿时间。
Technical Features and Learning Resources
该手册旨在服务于垃圾回收器的实现者以及需要配置它们以获得最佳性能的程序员。
Educational Tools
- Pseudocode and Illustrations: 通过视觉辅助工具和伪代码来解释复杂的算法和概念,以提高可访问性。
- Runtime Interface: 正文解释了垃圾回收的“棘手方面”,特别是回收器与运行时系统之间的接口。
Digital Enhancements and Research Database
- Hyperlinked E-book: 电子版本包含超过 37,000 个超链接,将章节、节、算法和术语表条目连接到原始研究论文。
- Bibliographic Database: 作者维护着一个包含近 3,400 篇垃圾回收相关出版物的在线数据库,为学术和专业研究提供摘要和 DOI。
Community Perspectives and Terminology Debates
虽然该手册被广泛认为是顶级资源,但社区讨论突出了关于该系列书籍所使用的术语的特定张力。
The "Garbage Collection" vs. "Automatic Memory Management" Debate
一些从业者认为,将“garbage collection”作为涵盖 tracing GC 和 reference counting 的统称词是具有误导性的。正如一位社区成员所指出的:
What I didn’t like about this series of books was choosing “garbage collection” as umbrella term for both tracing GC and reference counting... By that definition, C++ code has garbage collection if it uses std::shared_ptr, going against widespread common usage of the term “garbage collected programming language” which specifically contrasts manual languages like C++ or Rust against garbage collected ones.
这一批评建议,“Automatic Memory Management”是该领域更准确的描述,因为它涵盖了所有自动回收内存的方法,而不暗示特定的 tracing garbage collector 机制。