Presentation is loading. Please wait.

Presentation is loading. Please wait.

Andy C. King and Richard Jones University of Kent at Canterbury Removing GC Synchronisation.

Similar presentations


Presentation on theme: "Andy C. King and Richard Jones University of Kent at Canterbury Removing GC Synchronisation."— Presentation transcript:

1 Andy C. King and Richard Jones University of Kent at Canterbury Removing GC Synchronisation

2 Overview The Problem An Observation L & S Heaplets Implementation A Fly in the Ointment Swatting the Fly Measurements Future Work

3 Concurrency in multi-threaded applications Synchronisation is necessary Language level synchronized VM level mutator and garbage collector (GC) threads suspending threads before collecting the latter can be quite costly The Problem

4 Objects may be thread-local (L) Reachable only within their allocating thread do not need synchronisation for such objects Can manage these objects locally Place in per-thread heap regions called heaplets No need to stop other threads to collect such objects Shared objects (G) go in global heap An Observation

5 T1 T2 G L1 L2 L & G Heaplets

6 Variation on Steensgaard [Stee00] Escape analysis technique automatically determine local objects mark their allocation sites patch to use appropriate heaplet Flow-insensitive Context-sensitive (specialisation) performed at runtime Implementation

7 Implementation (2) Operates on a snapshot of the world set of classes loaded at that point in time JDK 1.22_06 Production Release for Solaris new GC with heaplets support specialisation patches applied in interpreter patched/specialised methods can be JIT’ed

8 Dynamic class loading Class loaded after snapshot May override method containing L allocation site Shares the object L allocation site now S (transitive closure) A Fly in the Ointment

9 1class A { 2public void do( Object o) { } 3} 4class Main { 5public static void main( String [] args) { 6 A a = new A (); 7 foo(a); SNAPSHOT ANALYSIS 30 A a’ = new A’ (); LOAD CLASS A’ 31 foo(a’); 32 } 33 public static void foo( A inA) { 34 Object o = new Object (); 35inA.do(o); 36} 37} A Fly in the Ointment (2)

10 Truly shared (G) reachable from >1 thread G heap Truly local (L) reachable from exactly 1 thread can prove type L heaplet Optimistically local (OL) reachable from 1 thread cannot prove type OL heaplet Swatting the Fly

11 T1 T2 G L1 L2 OL1 OL2 Swatting the Fly (2)

12 Analyse new classes immediately Compare methods If mismatched, OL sites are broken Class is non-conforming OL heaplet becomes G can be done very cheaply only OL heaplets of referring threads are affected Swatting the Fly (3)

13 T1 T2 G L1 L2 OL1 OL2 Swatting the Fly (4)

14 Measurements

15 Measurements (2)

16 Finally get the bloody numbers from the GC… Future Work

17 Andy C. King and Richard Jones University of Kent at Canterbury Q&A


Download ppt "Andy C. King and Richard Jones University of Kent at Canterbury Removing GC Synchronisation."

Similar presentations


Ads by Google