Thread-Local Hash Table Write Barrier for Garbage Collection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing garbage collection methods, particularly card marking and remembered set implementations, face issues with frequent TLB misses, cache contention, and overhead due to large data structures and complex synchronization requirements, especially in multi-core systems with large memories.

Innovation Solution

Implementing a thread-local hash table based write barrier buffer that stores addresses of written memory locations, using multiplicative hash tables with open addressing and linear probing to reduce overhead and improve cache locality, eliminating the need for costly synchronization primitives and extra object headers.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If card marking is used for write barrier, then the implementation is conceptually simple, but frequent TLB misses occur due to large card table size

Engineering Contradiction:
Improveimplementation simplicityVSAvoidTLB miss rate
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

The patent divides the write barrier buffer into multiple smaller segments or buckets instead of using a single large card table. Each segment handles a portion of the memory space, reducing the size of individual data structures and improving TLB cache hit rates while maintaining the simplicity of the card marking approach.

Inventive Principle:
Principle #1Segmentation

2Quantity of substance

If large card table is used to cover 64GB heap, then all memory locations can be tracked, but cache space is competed with application data reducing performance

Engineering Contradiction:
Improvememory coverageVSAvoidcache hit rate
Core Design Contradiction:
Quantity of substanceVSLoss of energy

Solution Approach 1:

The patent transitions from a two-dimensional card table structure to a hierarchical structure that adds another dimension of organization. Memory space is divided into regions, with each region having its own smaller hash table, effectively organizing data in multiple dimensions to reduce cache contention while maintaining full memory coverage.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

3Productivity

If remembered set buffer is used with separate background thread, then write barrier overhead is reduced, but system complexity increases

Engineering Contradiction:
Improvewrite barrier throughputVSAvoidsystem structure
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements a self-service mechanism where the write barrier buffer automatically manages its own contents using thread-local hash tables that are naturally isolated per thread. Each thread's writes are automatically tracked in its own hash table entry, eliminating the need for separate background threads or complex synchronization while maintaining high throughput.

Inventive Principle:
Principle #25Self-service

4Productivity

If card scanning is performed during compute-intensive operations, then garbage collection can proceed, but no idle processors are available increasing overhead

Engineering Contradiction:
Improvegarbage collection throughputVSAvoidscan time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent performs preliminary action by continuously maintaining updated hash table entries in the write barrier buffer during normal operation. When garbage collection needs to scan, the work has already been partially done through the continuous updates, reducing the actual scan time needed during compute-intensive operations when processors are busy.

Inventive Principle:
Principle #10Preliminary action

5Loss of energy

If thread-local hash tables are used instead of global card table, then cache locality is improved, but memory overhead per thread increases

Engineering Contradiction:
Improvecache efficiencyVSAvoidmemory per thread
Core Design Contradiction:
Loss of energyVSQuantity of substance

Solution Approach 1:

The patent applies local quality by making the write barrier data structure thread-local rather than global. Each thread has its own hash table entries in its local storage, providing excellent cache locality for that thread's operations. The local quality of thread-specific data structures optimizes performance for each thread while the overall system memory overhead is managed through the efficiency of hash table implementation.

Inventive Principle:
Principle #3Local quality

Data Source

PatentEP2558940B1Thread-local hash table based write barrier buffers
Publication Date: 2017.04.12 CLAUSAL COMPUTING
  • EP2558940B1 patent drawing
  • EP2558940B1 patent drawing
  • EP2558940B1 patent drawing

AI summary

A write barrier is implemented using thread-local hash table based write barrier buffers. The write barrier, executed by mutator threads, stores addresses of written memory locations or objects in the thread-local hash tables, and during garbage collection, an explicit or implicit union of the addresses in each hash table is used in a manner that is tolerant to an address appearing in more than one hash table.