Garbage Collection Thread Deque Size Evaluation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multi-threaded computing systems, determining which garbage collection thread to take tasks from becomes increasingly difficult as the number of threads increases, leading to inefficiencies and resource wastage due to the high overhead of memory fences and failed work-taking operations.

Innovation Solution

A method is implemented where a garbage collection thread evaluates multiple double-ended queues to determine the largest one, prioritizing tasks from the deque with the most work, dynamically adjusting the number of threads to compare based on system performance and wait times, thereby reducing the number of memory fences and improving load balancing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the number of garbage collection threads is increased to improve productivity, then more tasks can be processed in parallel, but it becomes difficult to determine which deque to take tasks from, increasing device complexity and overhead

Engineering Contradiction:
Improvegarbage collection throughputVSAvoiddeque selection complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system performs preliminary evaluation of multiple deques by comparing their sizes before selecting one for task acquisition. This preliminary action filters out empty or nearly-empty deques in advance, reducing the complexity of deque selection when the number of threads is large.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses feedback from deque size comparisons to dynamically adjust the search strategy. By monitoring which deques have the most tasks and using this information to guide subsequent selections, the system optimizes the balance between exploration and exploitation in the multi-threaded environment.

Inventive Principle:
Principle #23Feedback

2Reliability

If memory fences are used to ensure task acquisition safety, then data consistency is maintained, but the overhead increases significantly when task acquisition fails

Engineering Contradiction:
Improvetask acquisition consistencyVSAvoidmemory fence overhead
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The system performs preliminary evaluation of deque sizes before attempting task acquisition. By selecting deques that are more likely to contain tasks based on their size, the system reduces the frequency of failed acquisition attempts and consequently reduces the overhead from memory fences.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system converts the potentially harmful effect of deque size information into a beneficial selection criterion. Instead of ignoring deque sizes and relying solely on atomic operations, the system uses size information to guide selection, thereby reducing the need for conservative memory fence operations.

Inventive Principle:
Principle #22Blessing in disguise (Convert harm into benefit)

3Productivity

If all deques are evaluated to find the largest one, then load balancing is optimized, but the time and resources required for evaluation increase

Engineering Contradiction:
Improveload balancing efficiencyVSAvoiddeque evaluation time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system evaluates only a subset of deques rather than all deques, using a configurable number N that is less than the total number of deques. This partial action provides sufficient load balancing information without the full computational cost of evaluating every deque, optimizing the trade-off between balancing efficiency and evaluation time.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS10929054B2Scalable garbage collection
Publication Date: 2021.02.23 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10929054B2 patent drawing
  • US10929054B2 patent drawing
  • US10929054B2 patent drawing

AI summary

Methods and systems for performing memory garbage collection include determining a size of N double-ended queues (“deques”) associated with N respective garbage collection threads, where N is three or greater. A task is popped from a deque out of the N deques having a largest size. Garbage collection is performed on the popped task.