Old-Generation Garbage Collection With Lazy Reference Counting

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Atomic reference counting in garbage collection is computationally expensive and degrades performance due to the need for additional operations every time a reference changes, especially in old garbage collection generations.

Innovation Solution

Concurrent lazy reference counting is employed using remembered sets and allocated reference counting responsibilities between mutator and garbage collection threads, canceling out intermediate reference count increments and decrements to reduce computational overhead.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If atomic reference counting is used to track object references, then reference accuracy is improved, but computational overhead increases and performance degrades

Engineering Contradiction:
Improvereference counting accuracyVSAvoidprogram execution performance
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent divides reference counting into two separate phases: a lazy update phase during normal execution where reference counts are updated asynchronously, and a concurrent collection phase where the garbage collector processes the accumulated reference count changes. This segmentation allows reference counting to occur without blocking program execution, thus maintaining accuracy while improving performance.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary actions by having mutator threads record reference count changes in a deferred update structure during normal execution, rather than immediately updating reference counts. This preliminary recording of changes allows the actual update to be performed later in bulk during garbage collection, reducing the overhead during critical execution paths.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If atomic reference counting operations are performed on every reference change, then reference count accuracy is maintained, but computational cost increases

Engineering Contradiction:
Improvereference count correctnessVSAvoidcomputational energy consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

Instead of performing atomic reference counting operations on every reference change, the patent implements periodic action by batching multiple reference count updates together during concurrent garbage collection phases. The reference counts are updated periodically in bulk rather than continuously, reducing the total number of atomic operations required while maintaining correctness through the concurrent collection process.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The patent introduces an intermediary data structure (deferred update structure) that buffers reference count changes between the mutator threads and the garbage collector. This intermediary allows reference count changes to be recorded without immediate atomic updates, and the actual updates are performed later by the garbage collector, reducing computational energy consumption while maintaining reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If reference counting is implemented in old garbage collection generation, then memory reclamation accuracy is improved, but system complexity increases

Engineering Contradiction:
Improvegarbage identification accuracyVSAvoidgarbage collection system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent implements a universal reference counting mechanism that works across both young and old garbage collection generations using the same deferred update structure and concurrent update approach. This multi-functionality allows the system to maintain accurate reference counting in the old generation without requiring separate complex mechanisms, thereby improving garbage identification accuracy while managing system complexity through code reuse.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The garbage collector performs self-service by autonomously processing the accumulated reference count changes from the deferred update structure during concurrent collection. The system does not require external intervention or complex coordination to update reference counts in the old generation, as the garbage collector independently manages and applies the deferred updates, simplifying the overall system architecture while maintaining accuracy.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS12487924B2Concurrent lazy reference counting in an old garbage collection generation
Publication Date: 2025.12.02 ORACLE INT CORP
  • US12487924B2 patent drawing
  • US12487924B2 patent drawing
  • US12487924B2 patent drawing

AI summary

Techniques for concurrent lazy reference tracking in an old garbage collection generation are disclosed, including: encountering, by a mutator thread during a garbage collection epoch, a first instruction to write a first value to a field; responsive to encountering the first instruction to write the first value to the field: entering a slow-path write barrier; performing, by the slow-path write barrier, a first one or more reference counting operations with respect to the field; encountering, by the mutator thread during the first garbage collection epoch and subsequent to encountering the first instruction to write the first value to the field, a second instruction to write a second value to the field; responsive to encountering the second instruction to write the second value to the field: entering a fast-path write barrier; wherein the fast-path write barrier does not perform any reference counting operations with respect to the field.