Incremental Abortable Garbage Collection via Feedback-Based Region Selection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Garbage collectors in software programs often pause execution for extended periods, degrading user experience, as they struggle to balance throughput and usability during stop-the-world events, especially with large heaps, leading to reduced performance and potential accidental collection of live objects.

Innovation Solution

An incremental abortable garbage collector that uses feedback from previous collections to estimate and select regions within a heap for garbage collection within a constrained time window, allowing for partial collection during each stop-the-world event and adjusting estimates based on success or abortion to optimize throughput and minimize pause duration.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the garbage collector pauses all threads to reclaim memory from the heap, then memory integrity is maintained, but program execution is degraded

Engineering Contradiction:
Improvememory integrityVSAvoidprogram execution
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The heap is divided into multiple regions, and the garbage collector processes these regions incrementally rather than all at once. This segmentation allows the collector to make progress on memory reclamation while keeping individual pause durations short, thus maintaining both memory integrity and program productivity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The garbage collector performs periodic collection cycles on different heap regions, alternating between collecting from one region while other regions remain active. This periodic action pattern allows threads to resume execution in between collection phases, reducing overall pause impact while continuing memory reclamation.

Inventive Principle:
Principle #19Periodic action

2Productivity

If the garbage collector uses a long pause duration, then garbage collection throughput is improved, but user experience is degraded

Engineering Contradiction:
Improvegarbage collection throughputVSAvoidpause duration
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The garbage collector dynamically adjusts which heap regions to collect and in what order based on runtime conditions, thread activity, and progress made. This dynamic approach allows the collector to optimize throughput by selecting regions with higher garbage density while keeping pause durations adaptive to user experience requirements.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system uses feedback from previous collection cycles to inform future region selection decisions. By analyzing which regions yielded the most garbage and which caused longer pauses, the collector can make informed decisions about future collection targets, improving throughput while avoiding problematic pause patterns.

Inventive Principle:
Principle #23Feedback

3Productivity

If the garbage collector processes the entire heap, then complete memory reclamation is achieved, but pause duration increases

Engineering Contradiction:
Improvememory reclamationVSAvoidpause duration
Core Design Contradiction:
ProductivityVSDuration of action of moving object

Solution Approach 1:

The heap is divided into multiple regions that can be collected independently and incrementally. This segmentation enables the garbage collector to process portions of the heap over multiple shorter pause events rather than requiring a single long pause to collect the entire heap, thus achieving complete reclamation while limiting individual pause durations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The garbage collection process continues across multiple pause events rather than requiring a single continuous long pause. By resuming and continuing collection in subsequent pauses, the system maintains continuous progress toward complete memory reclamation while keeping each individual pause short enough to preserve user experience.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS11294806B2Feedback-based selection of regions for abortable garbage collection
Publication Date: 2022.04.05 ORACLE INT CORP
  • US11294806B2 patent drawing
  • US11294806B2 patent drawing
  • US11294806B2 patent drawing

AI summary

The disclosed embodiments provide a method, apparatus, and system for selecting, based on feedback from previous garbage collections, a portion of a referenced memory area for garbage collection within a time window. During the execution of a software program, the system selects a given portion of a referenced memory area on which garbage collection can be completed within the given time window and attempts to complete garbage collection on at least the given portion of the referenced memory area before the end of the given time window. Next, the system selects, based on the results of the garbage collection performed during the given time window, a subsequent portion of the referenced memory area on which garbage collection can be completed within the subsequent time window and attempts to complete garbage collection on at least the subsequent portion of the referenced memory area before the end of the subsequent time window.