NG2C:为HotSpot大数据应用程序提供N代GC
NG2C: Pretenuring N-Generational GC for HotSpot Big Data Applications
摘要:
由于垃圾回收(GC),大数据应用程序会遭受不可预测和不可接受的高暂停时间。这是在线信用卡欺诈检测、用于社交网络分析的基于图的计算等对延迟敏感的应用程序的情况。此类暂停损害了整个应用程序堆栈的延迟要求,并且是由应用程序对数据的积极缓冲/缓存引起的,从而暴露了不合适的GC设计,它假定大多数对象会在年轻时死亡,并且没有考虑应用程序在内存中保存大量的中间数据。为了避免这样的停顿,我们提出了NG 2C,一个新的GC算法,结合了预处理与N代堆。通过能够将对象分配到不同的代,NG 2C能够将具有相似生命周期配置文件的对象分组在同一代中。通过将具有相似生命周期配置文件的对象分配到彼此接近的位置,即在同一代中,我们避免了对象提升(代间复制)和堆碎片(导致堆压缩),这两种情况都是HotSpot GC暂停时间的大部分持续时间。NG 2C是为OpenJDK 8 HotSpot Java虚拟机实现的,作为Garbage First GC的扩展。我们使用Cassandra,Lucene和GraphChi评估NG 2C,并使用三种不同的GC:垃圾优先(G1),并发标记扫描(CMS)和NG 2C。结果表明,与集流体(G1和CMS)相比,NG 2C使Cassandra的最差可观察GC暂停时间减少了94.8%,Lucene减少了85.0%,GraphChi减少了96.45%。此外,NG 2C对应用程序吞吐量或内存使用没有负面影响。
英文摘要:
Big Data applications suffer from unpredictable and unacceptably high pause times due to Garbage Collection (GC). This is the case in latency-sensitive applications such as on-line credit-card fraud detection, graph-based computing for analysis on social networks, etc. Such pauses compromise latency requirements of the whole application stack and result from applications' aggressive buffering/caching of data, exposing an ill-suited GC design, which assumes that most objects will die young and does not consider that applications hold large amounts of middle-lived data in memory. To avoid such pauses, we propose NG2C, a new GC algorithm that combines pretenuring with an N-Generational heap. By being able to allocate objects into different generations, NG2C is able to group objects with similar lifetime profiles in the same generation. By allocating objects with similar lifetime profiles close to each other, i.e. in the same generation, we avoid object promotion (copying between generations) and heap fragmentation (which leads to heap compactions) both responsible for most of the duration of HotSpot GC pause times. NG2C is implemented for the OpenJDK 8 HotSpot Java Virtual Machine, as an extension of the Garbage First GC. We evaluate NG2C using Cassandra, Lucene, and GraphChi with three different GCs: Garbage First (G1), Concurrent Mark Sweep (CMS), and NG2C. Results show that NG2C decreases the worst observable GC pause time by up to 94.8% for Cassandra, 85.0% for Lucene and 96.45% for GraphChi, when compared to current collectors (G1 and CMS). In addition, NG2C has no negative impact on application throughput or memory usage.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。