Skip to main content
QUICK REVIEW

[Paper Review] NG2C: Pretenuring N-Generational GC for HotSpot Big Data Applications

Rodrigo Bruno, Luís Picciochi Oliveira|arXiv (Cornell University)|Apr 12, 2017
Cloud Computing and Resource Management55 references3 citations
TL;DR

NG2C is a novel garbage collection algorithm for HotSpot JVM that reduces GC pause times in big data workloads by pretenuring objects into an N-generational heap based on lifetime profiles, minimizing object copying and fragmentation. It achieves up to 96.45% reduction in worst-case pause times across Cassandra, Lucene, and GraphChi with no throughput or memory overhead compared to G1 and CMS.

ABSTRACT

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.

Motivation & Objective

  • To address unpredictable and high GC pause times in latency-sensitive big data applications running on HotSpot JVM.
  • To overcome the limitations of the weak generational hypothesis, which assumes most objects die young, by adapting GC to real object lifetime profiles in big data workloads.
  • To reduce object copying and heap fragmentation—key causes of long GC pauses—by grouping objects with similar lifetimes into dedicated generations.
  • To design a GC solution that maintains high application throughput and memory efficiency while drastically reducing worst-case pause times.
  • To enable developers to avoid manual GC tuning by automating lifetime-aware pretenuring via a profiler tool.

Proposed method

  • NG2C extends the Garbage First (G1) GC by introducing an N-generational heap structure that separates objects based on their lifetime profiles.
  • Objects are pretenured directly into appropriate generations at allocation time, based on profiling data from the Object Lifetime Recorder (OLR) tool.
  • The algorithm avoids intergenerational copying and heap compaction by ensuring objects with similar lifetimes are allocated together in the same generation.
  • The system uses a profiler (OLR) to analyze application behavior and automatically generate annotations for allocation sites to guide pretenuring decisions.
  • NG2C integrates with OpenJDK 8 HotSpot and modifies object allocation and generation management to reduce copying and fragmentation.
  • The design preserves existing GC mechanisms like remembered sets and concurrent marking, focusing only on allocation and generation placement.

Experimental results

Research questions

  • RQ1Can pretenuring objects into multiple generations based on lifetime profiles reduce GC pause times in big data workloads?
  • RQ2Does grouping objects with similar lifetimes in dedicated generations reduce object copying and heap compaction?
  • RQ3Can NG2C maintain high application throughput and memory efficiency while reducing worst-case GC pause times?
  • RQ4To what extent can NG2C outperform existing collectors like G1 and CMS in latency-sensitive big data applications?
  • RQ5Can automated lifetime profiling enable effective pretenuring without manual tuning or application-specific configuration?

Key findings

  • NG2C reduces the worst observable GC pause time by up to 94.8% in Cassandra compared to G1 and CMS.
  • For Lucene, NG2C achieves an 85.0% reduction in worst-case pause times relative to the baseline collectors.
  • In GraphChi, NG2C reduces worst-case pause times by 96.45%, demonstrating superior performance in graph-processing workloads.
  • Despite increased allocation complexity, NG2C maintains application throughput comparable to G1 and CMS, with no measurable memory overhead.
  • NG2C reduces object copying by up to 89.2% compared to G1 and CMS, directly addressing the root cause of long pauses.
  • NG2C achieves 66% shorter pause times than CMS and 39% shorter than G1, even when configured for maximum throughput.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.