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
Engineering 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
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.
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.
2Productivity
If thread local heaps are used to avoid locking bottlenecks, then allocation performance is improved, but memory management complexity increases
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.
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.
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
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.
Data Source
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.


