Download presentation
Presentation is loading. Please wait.
Published byClinton Weaver Modified over 9 years ago
1
Dusty Caches for Reference Counting Garbage Collection Scott Friedman, Praveen Krishnamurthy, Roger Chamberlain, Ron K. Cytron, Jason Fritts Dept. of Computer Science and Engineering Washington University in St. Louis Sponsored by NSF grant ITR-0313203
2
2 Outline Introduction –Reference counting garbage collection Dusty cache –Design and policy Evaluating dusty caches –Quantifying performance using JVM –Experiment on Liquid Architecture Conclusions
3
3 Garbage collection –Java, C# –Unused objects are reclaimed Techniques –Reference counting –Mark and sweep –Copy and collect … Introduction
4
4 Reference Counts P = new Integer(..); class members P Integer 1 reference count
5
5 Reference Counts P = new Integer(..); Q = P; class members P Integer 2 reference count Q
6
6 Reference Counts P = new Integer(..); Q = new Integer(..); class members P 1 Q 1
7
7 Reference Counts P = Q; class members P 2 Q 0 “ Garbage ”
8
8 Ref. counts & Memory Traffic Short-lived (temporary) changes in reference counts –Linked lists, trees, sorting, hashtables etc. node 0node 1node 2node n head
9
9 Ref. counts & Memory Traffic node 0 1 node 1 1 node 2 1 node n 1 head linkedList list; iterator iter = list.iterator(); while(iter.hasNext()) { Object item = iter.next(); foo(item); }
10
10 Ref. counts & Memory Traffic node 0 2 node 1 1 node 2 1 node n 1 head linkedList list; iterator iter = list.iterator(); while(iter.hasNext()) { Object item = iter.next(); foo(item); } iter
11
11 Ref. counts & Memory Traffic node 0 1 node 1 2 node 2 1 node n 1 head linkedList list; iterator iter = list.iterator(); while(iter.hasNext()) { Object item = iter.next(); foo(item); } iter
12
12 Ref. counts & Memory Traffic node 0 1 node 1 1 node 2 2 node n 1 head linkedList list; iterator iter = list.iterator(); while(iter.hasNext()) { Object item = iter.next(); foo(item); } iter
13
13 Ref. counts & Memory Traffic node 0 1 node 1 1 node 2 1 node n 2 head linkedList list; iterator iter = list.iterator(); while(iter.hasNext()) { Object item = iter.next(); foo(item); } iter
14
14 Ref. counts & Memory Traffic node 0 1 node 1 1 node 2 1 node n 1 head Consequence –Every object is marked dirty in the cache Will be written back to RAM upon eviction –Unnecessary writes to RAM Temporally silent stores (Lepak & Lipasti, 2002) Our solution - Dusty Cache –Eliminates all such unnecessary writes to memory
15
15 Outline Introduction –Reference counting Dusty caches –Design and operations Evaluating dusty caches –Quantifying performance using JVM –Experiment on Liquid Architecture Conclusions
16
16 Cache Design: WriteBack cache lines tagd data address cached value tagoffsetvaliddirty x ABCD 1 01 1x x x x Read: update the tag, valid and data Write: update dirty and data
17
17 Read: update tag, data and image Cache Design: Dusty cache lines tagd data address cached value x x d image mem value tagoffsetvaliddirtyivalid ABCD 1 01 1 x ABED x Writes: update tag and data
18
18 Outline Introduction –Reference counting Dusty cache –Design and operations Evaluating dusty caches –Quantifying performance using JVM –Experiment on Liquid Architecture Conclusions
19
19 Evaluating Dusty Cache Traces from JVM instrumentation –Sun ’ s Java Virtual Machine Reference counting garbage collection –Reference count for all objects –# of JVM instructions between reference count changes –# of cache altering instructions between changes Eviction from cache window: for a window of size ‘ k ’ cache writes, a value ‘ v ’ written at write ‘ i ’ will be evicted at write ‘ i+k ’
20
20 JVM: Quantifying Memory Savings Cache configurations –Unified, Non-unified caches WriteThrough, WriteBack, Dusty Measured as “ memory writes saved ” –Baseline was a WriteThrough cache
21
21 1. SPEC DataBase 8,088 objs ~10%
22
22 2. SPEC JESS 46,129 objs ~15%
23
23 Experiments on a flexible processor Liquid Architecture –Platform to study microarchitecture refinements –Softcore LEON2: 5-stage SPARC compliant 32-bit –Statsmod: ‘ non intrusive ’ performance measurement tool Limitations –4 MB of SRAM, No JVM
24
24 Experiment on Liquid Architecture Deployed LEON with a ‘ dusty ’ cache policy –Replicated all of the L1 cache Monte Carlo Experiment –Determine probability of cache altering events Reads, Writes, HeapRefCount++, HeapRefCount-- –Events access random addresses in memory –Experiments monitored both RC and non-RC traffic
25
25 Emulation using Liquid Architecture Results of the Monte Carlo Experiment 50% reduction
26
26 Conclusions Dusty cache policy effectively filters the unnecessary reference counting traffic –Savings around 5 - 25 % over WB cache Microarchitecture optimization –Dusty cache can be a small subset of the cache Could potentially reduce writes even in non- reference counting traffic –Inferred from Characterization of silent stores (Bell et al. 2000)
27
27 Liquid Architecture Project http://www.arl.wustl.edu/liquid Email: liquid@cs.wustl.eduliquid@cs.wustl.edu Sponsored by NSF grant ITR-0313203
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.