Garbage-First GC Pause Time Prediction via Concurrent Thread Tracking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Garbage-First garbage collectors do not accurately predict pause times due to not accounting for concurrent marking and summarizing activities, leading to unpredictable delays in memory reclamation, which is critical for real-time and interactive systems.

Innovation Solution

Adjust the time cost of collecting a region in the Garbage-First garbage collector by tracking and accounting for concurrent garbage collector thread activity, using short time windows to measure and sum the percentage of elapsed time dedicated to each thread, and smoothing variations in overhead measurements.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If Garbage-First garbage collector uses space-incremental collection with concurrent marking, then memory reclamation can proceed without stopping the world, but pause times become unpredictable and difficult to predict

Engineering Contradiction:
Improvememory reclamation throughputVSAvoidpause time prediction accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent implements feedback mechanisms by continuously monitoring concurrent marking activity and using this information to adjust pause time predictions. The system measures the rate of concurrent marking during collection increments and feeds this information back into the prediction model, allowing dynamic adjustment of expected pause times based on actual system state

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent performs preliminary measurements of concurrent marking rates during collection increments before actual pauses occur. By measuring the activity level of concurrent marking threads in advance, the system can predict pause times more accurately before the pause actually happens, rather than relying on static estimates

Inventive Principle:
Principle #10Preliminary action

2Ease of operation

If concurrent marking threads operate during garbage collection, then application execution continues without interruption, but the overhead of concurrent activity increases total collection time

Engineering Contradiction:
Improveapplication continuityVSAvoidgarbage collection overhead
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The patent applies partial action by having concurrent marking threads operate at reduced intensity during collection increments rather than at full capacity. The system allows marking to proceed concurrently but at a controlled rate that balances application continuity with collection progress, accepting that some marking may extend beyond the pause period

Inventive Principle:
Principle #16Partial or excessive action

3Reliability

If the entire heap memory is scanned during garbage collection, then complete memory reclamation is achieved, but application threads must be suspended for long periods

Engineering Contradiction:
Improvememory reclamation completenessVSAvoidpause duration
Core Design Contradiction:
ReliabilityVSDuration of action of moving object

Solution Approach 1:

The patent segments the heap into collection sets and processes them incrementally during separate collection increments. Instead of scanning the entire heap in one pause, the system divides memory into manageable portions and processes them over multiple shorter intervals, with concurrent marking operating between pauses to maintain application continuity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent maintains continuity of useful action by having concurrent marking threads continuously scan and mark objects during collection increments and between pauses. This ongoing marking activity ensures that when a pause does occur, the amount of work required is reduced, allowing complete reclamation without long suspensions

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS7672983B2Method and apparatus for tracking activity of a garbage collector with a plurality of threads that operate concurrently with an application program
Publication Date: 2010.03.02 ORACLE AMERICAN INC
  • US7672983B2 patent drawing
  • US7672983B2 patent drawing
  • US7672983B2 patent drawing

AI summary

The time cost of collecting a region in a Garbage-First garbage collector is adjusted to account for concurrent thread activity. The overhead of a concurrent thread is tracked by dividing elapsed time into relatively short time “windows” and monitoring the system during those windows to determine how long that thread is scheduled to run during those windows. Using measurements of this type for each concurrent thread, the percentage of each elapsed time window dedicated to each concurrent thread is determined. Finally, by summing the percentages of elapsed time dedicated to concurrent thread activity, the cost of collecting a region can be increased by adding the overhead attributable to concurrent activity.