Thread Local Heap Segmentation for Virtual Machine Garbage Collection

Solution Overview

Problem

Current techniques for thread local garbage collection in virtual machine environments are not efficient enough to justify the increase in concurrency, leading to suboptimal pause times and locking costs, which affects the performance of transaction-based services.

Innovation Solution

A system and method for maintaining and garbage collecting thread local heaps efficiently, improving cache locality, reducing locking costs, and allowing parallel collection of thread local heaps with only stop-the-world pauses for the global heap, while ensuring that thread local objects are not referenced from other thread execution contexts or heaps, using a page fault optimizer and efficient barrier implementations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If thread local garbage collection is implemented to reduce pause times, then concurrency and pause time performance are improved, but locking costs and system complexity increase

Engineering Contradiction:
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The heap is segmented into thread local heaps and a global heap. Each thread has its own thread local heap for object allocation, allowing independent garbage collection of each thread's objects without requiring stop-the-world pauses. This segmentation enables concurrent garbage collection while reducing pause times.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Thread local object allocation is extracted from the global heap management system. By giving each thread its own heap space, the patent separates thread local garbage collection from global heap operations, eliminating the need for locks during thread local collection and reducing pause times.

Inventive Principle:
Principle #2Taking out (Extraction)

2Productivity

If thread local heaps are used to avoid locking bottlenecks, then allocation performance is improved, but memory management complexity increases

Engineering Contradiction:
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The memory space is divided into separate thread local heaps and a global heap. Each thread local heap is managed independently by its owning thread, eliminating the need for global locking during allocation. This segmentation improves allocation performance while the structured organization keeps memory management manageable.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each thread is responsible for managing its own thread local heap and performing garbage collection on its own objects. This self-service approach eliminates the need for inter-thread locking during allocation and garbage collection, improving performance while distributing management responsibility.

Inventive Principle:
Principle #25Self-service

3Loss of time

If concurrent garbage collection is implemented to reduce stop-the-world pauses, then pause time is improved, but CPU time consumption increases

Engineering Contradiction:
Core Design Contradiction:
Loss of timeVSUse of energy by moving object

Solution Approach 1:

By segmenting the heap into thread local heaps, the patent enables concurrent garbage collection where each thread can collect its own objects independently. This eliminates stop-the-world pauses while the distributed nature of collection minimizes total CPU time compared to sequential collection of all objects.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8024505B2System and method for optimistic creation of thread local objects in a virtual machine environment
Publication Date: 2011.09.20
  • US8024505B2 patent drawing
  • US8024505B2 patent drawing
  • US8024505B2 patent drawing

AI summary

A system for thread local garbage collection in a virtual machine environment, comprising: a virtual machine for executing a software application; a memory space for use by the virtual machine in storing software objects and pointers as part of the software application, divided into a global heap and several thread local heaps; a heap maintaining logic that keeps the global heap and the thread local heaps in a state suitable for efficient garbage collecting; and a garbage collector that can collect the thread local heaps in parallel with only the stop-the-world pauses for the global heap.