Zero-Copy Large Object Promotion in Generational Heap GC
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current garbage collection methods face challenges in efficiently promoting large objects from the young generation to the old generation, particularly in region-based garbage collectors, as they often require costly copying and can lead to increased pressure on the young generation and premature tenuring of objects.
Innovation Solution
The introduction of large memory regions and a system that promotes large young objects to large old objects without copying by setting region types from young to old in the region table, scavenging references, and releasing unvisited memory regions, allowing for efficient tenuring of large objects at no-copying cost.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If large young objects are promoted to old generation using copying mechanism, then objects reach maturity and can be collected independently, but memory and resource overhead increases significantly due to the copying cost
Solution Approach 1:
The patent applies copying selectively only to small objects that need to be evacuated during young generation collection, while large objects that survive the collection cycle are promoted to old generation without copying. This resolves the contradiction by eliminating unnecessary copying of large objects while still maintaining the copying mechanism for small objects that require evacuation.
Solution Approach 2:
The patent changes the parameter of object promotion from 'copying required' to 'promotion without copying' based on object size and survival status. Large objects that survive young generation collection are promoted by changing their generation status parameter without physical copying, thereby reducing memory overhead while maintaining reliability.
2Productivity
If copying mechanism is used for all objects in young generation, then all objects can be collected and promoted uniformly, but large objects cause excessive memory pressure and resource consumption
Solution Approach 1:
The patent segments the object population into small objects and large objects, applying different collection and promotion strategies to each segment. Small objects undergo copying collection, while large objects are handled through a separate promotion path that avoids copying, thereby improving overall collection efficiency while reducing memory pressure from large object handling.
Solution Approach 2:
The patent applies partial copying action only to small objects that need evacuation, rather than copying all objects. This partial action approach maintains collection efficiency for small objects while avoiding the excessive memory pressure that would result from copying large objects.
3Loss of energy
If large objects are allocated directly in old generation, then no copying is needed for promotion, but young generation pressure increases and objects mature prematurely
Solution Approach 1:
The patent allocates large objects to a special large object space before they are fully mature, allowing them to reside in a protected space during their young phase. This preliminary action prevents them from exerting pressure on the regular young generation and avoids premature tenuring, while still enabling promotion without copying later.
4Speed
If region-based garbage collection is used, then pause time is limited and responsiveness improves, but large object promotion becomes more complex with region type management
Solution Approach 1:
The patent extracts large object management from the regular region-based collection mechanism by creating a separate large object space and dedicated promotion path. This extraction simplifies region type management by removing large objects from the complex young/old region type system, while still maintaining the responsiveness benefits of region-based collection for small objects.
Data Source
AI summary
A method for performing garbage collection promotion, comprising determining that an age of a large young object is greater than a predetermined tenuring threshold, wherein the predetermined tenuring threshold specifies an age beyond which objects are promoted, setting a plurality of types of a plurality of large memory regions from young to old to promote the large young object to a large old object, wherein the plurality of large memory regions host the large young object, scavenging references of the large old object, wherein the large old object is a large promoted object, scanning a large young object list to identify a plurality of unvisited large young objects, wherein a plurality of visited bits of the plurality of unvisited large young objects are unset, and releasing a plurality of unvisited large memory regions, wherein the unvisited large memory regions host the plurality of unvisited large young objects.


