Rifat Shahriyar Stephen M Blackburn Australian National University Kathryn S M cKinley Microsoft Research GC is Ubiquitous GC implementations Exact Conservative High performance systems use exact GC ID: 536575
Download Presentation The PPT/PDF document "Fast Conservative Garbage Collection" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Fast Conservative Garbage Collection
Rifat ShahriyarStephen M. BlackburnAustralian National University
Kathryn S. McKinleyMicrosoft ResearchSlide2
GC is Ubiquitous
GC implementations Exact ConservativeHigh performance systems use exact GCConservative GC is popular
2
roots
roots
heap
heap
roots
heap
conservative
exactSlide3
Performance
3
16% slowdown a show-stopper in many situationsSlide4
Root Conservative GC
4
roots
heap
intSlide5
Ambiguous References
May be pointersRetain referents, transitivelyExcess retentionMay be valuesCannot change values Pin referentsMay
corrupt heapValidate before updating per-object metadata5Slide6
Why Conservative GC
AdvantagesDisentangles GC from compilerAvoids challenging engineering of stack mapsEnables more compiler optimizations
DisadvantagesMust handle ambiguous referencesPerformance6
Our goal is high
performance
conservative
GC for managed languagesSlide7
High Performance Exact Garbage Collectors
7Slide8
Immix [Blackburn & McKinley 2008]
0
Contiguous allocation into regions
256B lines and 32KB blocks
Objects span lines but not blocks
Simple mark phase
Mark objects and containing regions
Free unmarked regions
Recycled allocation and defragmentation
8
block
line
recyclable lines
object mark
line mark
line
line
lineSlide9
RC Immix [Shahriyar et al. 2013]
Combines RC and
Immix
Object
local collection
Great mutator locality
Exploit Immix’s opportunistic
copy
New objects can be copied by first GC
Old objects can be copied by backup
GC
Copying
with RC to eliminate
fragmentation
0
0
9
1
3
1
2
1
1
3
2
1
2
2
0
0Slide10
Conservative Garbage Collectors
10Slide11
Non-Moving Free list
Designed for fully conservative settings ProblemsPoor performance
Overly conservative design for many settings11
roots
heapSlide12
Mostly-Copying Semi Space
a.k.a. Bartlett-style, with many variantsProblems
Semi-space suffers from huge collection costPoor performance12
roots
heapSlide13
All
exact217
Unique exact980.45xAll cons.4612.12xUnique cons.1571.6x
13
44 KB
0.02%
Actual pinned
14 KB
0.05%
MCC pinned
462
KB
2.1%
MCC false
pinned
282
KB
Immix pinned
36 KB
0.2%
Excess retention
Pinning
RootsCost of Conservatismaveraged over 20 Java benchmarks
The direct cost of conservatism is very low Slide14
Heap Organization is Key
14Slide15
Outline
Real source of performance overhead is not conservatism but heap organizationDesign and implementation ofConservative Immix collectorsConservative reference counting
Evaluation15Slide16
Design
16Slide17
Filtering
Object map filters ambiguous referencesBitmap records locations of all live objects Allocator sets bit encoding object start address
Collector clears bit for dead objects 17
roots
heapSlide18
Cost of Filtering
18
Heap organization trumps object map overhead (2.7%)Slide19
Pinning
Immix line pinning, opportunistic copyingPin referents of ambiguous referencesLogically pinned lines cannot be reusedMove other objects as space permits
19
roots
heapSlide20
Results
20Slide21
Methodology
20 benchmarksDaCapo, SPECjvm98 and pjbb200520 invocations for each benchmarkJikes RVM and MMTkAll garbage collectors are parallelIntel Core i7 4770, 8GB
Ubuntu 12.04.3 LTS21Slide22
Cost of Conservatism
normalized to exact22Low performance penalty for conservative collectors
conscons
cons
consSlide23
cons
Total
Time23RC Immixcons matches Gen Immix and RC ImmixSlide24
Total Time v Heap Size
24
RC Immixcons matches Gen Immix and RC ImmixconsSlide25
Wider Applicability
25Slide26
Conservatism and Pinning
Amenability of existing systems to conservative RC ImmixQuantify ambiguous references in target applicationsConservative RC Immix
tolerates 8x pinning increase with only 3.4% overheadModify heap organization to use lines and blocks Implement full-heap tracing Immix collector (5% improvement)Depends on code quality26Slide27
Summary
Conservative GCDominated by BDW and MCCSignificant overheadsHeap org. key to performanceNew designsLow overhead object mapImmix line based pinning
Conservative RC ImmixMatches fastest production27Questions?
Available at:
https://jira.codehaus.org/browse/RVM-1085