Presentation is loading. Please wait.

Presentation is loading. Please wait.

Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.

Similar presentations


Presentation on theme: "Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland."— Presentation transcript:

1 Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland

2 2Compiler Construction, April 2005Age-Oriented GC Garbage Collection User allocates space dynamically, the garbage collector automatically frees the space when it no longer reachable by a path of pointers from program local references (roots). Programmer does not have to decide when to free an object. (Memory leaks, dangling pointers.) Built into Java, C#.

3 3Compiler Construction, April 2005Age-Oriented GC Garbage Collection Today Today’s advanced environments: –multiprocessors + large memories Dealing with multiprocessors Single-threaded stop the world

4 4Compiler Construction, April 2005Age-Oriented GC Garbage Collection Today Today’s advanced environments: –multiprocessors + large memories Dealing with multiprocessors Concurrent collectionParallel collection High throughputShort pauses

5 5Compiler Construction, April 2005Age-Oriented GC Outline Garbage collection and modern platforms  Properties of classical algorithms Generational garbage collection Age-oriented collection Implementation, measurements Conclusion

6 6Compiler Construction, April 2005Age-Oriented GC Garbage Collection Two Classical Approaches Reference counting [Collins 1960]: keep a reference count for each object, reclaim objects with count 0. Tracing [McCarthy 1960]: trace reachable objects, reclaim objects not traced. Complexity: - traversal of live objects - (sweep is typically fast) Complexity: - tracking pointer modific’s - traversal of dead objects

7 7Compiler Construction, April 2005Age-Oriented GC Choosing a Collector Reference counting Best when most objects alive, and low “activity”. Tracing: Best when most objects dead. When are objects typically dead? The generational hypothesis: most objects die young.

8 8Compiler Construction, April 2005Age-Oriented GC Generational Garbage Collection [Lieberman-Hewitt 83, Ungar 84]: Segregate objects by age into generations. Objects allocated in the young generation, promoted into the old generation if they survive long enough. Frequently collect the young generation Collect full heap when needed. Most pauses are short (for young generation GC). Collection effort concentrated where garbage is. Old Young

9 9Compiler Construction, April 2005Age-Oriented GC Note Interesting Characteristics Young generation: most objects die & high activity. Tracing is best when most objects die. Old generation: most objects alive and slow activity. Reference counting is best. Conclusion: use RC for old & tracing for young. Already done by [Azatchi-Petrank CC’03] [Blackburn-Mckinley OOPSLA’03]

10 10Compiler Construction, April 2005Age-Oriented GC Size of Young Generation small young generation  (mostly) short pauses large young generation  high efficiency Appel’s collector uses a large young generation and obtains highest efficiency.

11 11Compiler Construction, April 2005Age-Oriented GC Observation 1 large young generation  high efficiency but long pauses concurrent collector  short pauses Observation 1: we want the largest possible young generation.

12 12Compiler Construction, April 2005Age-Oriented GC Observation 2 Delaying collection of the old generation is fundamentally tracing- oriented. Complexity of tracing is fixed: delay it. Complexity of RC accumulates (update counters, traverse the unreachable) no use in delaying it.

13 13Compiler Construction, April 2005Age-Oriented GC Observation 2 Delaying collection of the old generation is fundamentally tracing- oriented. We use RC for old generation Observation 2: No use in delaying collection of old objects.

14 14Compiler Construction, April 2005Age-Oriented GC Conclusion Observation 1: we want the largest possible young generation. Observation 2: no use in delaying collection of old objects. Conclusion (age-oriented collection): collect entire heap with each collection

15 15Compiler Construction, April 2005Age-Oriented GC Age-Oriented vs. Generational Age-Oriented Always collect entire heap Collect each generation differently Generational Frequently collect young generation Collect young generation and full heap differently

16 16Compiler Construction, April 2005Age-Oriented GC Generational vs. Age-Oriented Old Young Old Young Old Young Age- Oriented: Old Young Old Young Old Young Old Young Old Young Old Young Old Young Standard: time

17 17Compiler Construction, April 2005Age-Oriented GC Age-Oriented Properties Advantages: Largest possible young generation. No frequent young collections. Each generation is treated according to its characteristics (like generational collectors). Potentially easier to obtain inter-generat’l ptr’s. Young Generation Old Generation A B

18 18Compiler Construction, April 2005Age-Oriented GC Age-Oriented Properties Advantages: Largest possible young generation. No frequent young collections. Each generation is treated according to its characteristics (like generational collectors). Potentially easier to obtain inter-generat’l ptr’s. Disadvantages: Longer pauses (if we don’t use concurrent GC.) May have a throughput penalty if tracing the old generation (not an issue for RC).

19 19Compiler Construction, April 2005Age-Oriented GC Age-Oriented Collection Age-Oriented Always collect entire heap Collect each generation differently A general framework: instantiated by picking collectors for the old and young generations and combining them.

20 20Compiler Construction, April 2005Age-Oriented GC Our Instantiation Building blocks: the sliding views collectors [Levanoni-Petrank 01, Azatchi et al. 03] –Old generation: concurrent RC. –Young generation: concurrent tracing. Technicalities: –Joining the two collectors –Inter-generational pointers

21 21Compiler Construction, April 2005Age-Oriented GC Implementation Implementation for Java on the Jikes Research JVM Compared collectors: –RC with no generation. –Generational: tracing for young & RC for full. Benchmarks: –SPECjbb2000: simulates business-like trans’s. –SPECjvm98: client benchmarks suite. Platform: a 4-Way Netfinity.

22 22Compiler Construction, April 2005Age-Oriented GC Pause Times vs. STW

23 23Compiler Construction, April 2005Age-Oriented GC SPECjbb Throughput (Age-Oriented vs. RC)

24 24Compiler Construction, April 2005Age-Oriented GC SPECjbb Throughput (Generational vs. RC)

25 25Compiler Construction, April 2005Age-Oriented GC SPECjvm98 Throughput (Age-Oriented vs. RC)

26 26Compiler Construction, April 2005Age-Oriented GC Throughput versus Parallel Tracing

27 27Compiler Construction, April 2005Age-Oriented GC Related Work [Azatzhi-Petrank CC’03] Concurrent generations with RC for full and tracing for young. (Very short pauses.) [Blackburn-Mckinley OOPSLA’03] Generations with RC for old and tracing for young. Non concurrent but controlled pauses. [Paz et al. CC’05] (coming soon…) Cycle Collection --- better do it only for old objects, via age-oriented collection. RC: some recent breakthrough, still work needed to get RC “right” for modern platforms.

28 28Compiler Construction, April 2005Age-Oriented GC Concurrent & Generational GC A general question for concurrent collectors: –Concurrent collectors already have short pauses, should we also use generations ? First experiment [Domani et al. PLDI’00]: –Beneficial, but unsteady improvements (-8% -- 25%). –Base was production JVM with mark & sweep. Second experiment: [Azatchi-Petrank, CC’03]: –Beneficial, 10-20% improvement. –Base was Jikes RVM with RC. Third try: Mostly Concurrent [ISMM’00, PLDI’02, OOPSLA’03]: –SUN: yes, no measurements. –IBM: no, (and no measurements). Fourth experiment: this work…

29 29Compiler Construction, April 2005Age-Oriented GC Conclusion The Age-Oriented collector improves efficiency of generational collectors –Especially with RC on old. –Especially with concurrent collectors. It is a framework, we tried an instantiation with: –Concurrent RC for old, concurrent tracing for young. The age-oriented collector was non-obtrusive (due to concurrency) and efficient (due to age- oriented) collector. An excellent way to employ RC.


Download ppt "Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland."

Similar presentations


Ads by Google