Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Error-Free Garbage Collection Traces: How to Cheat and Not Get Caught ACM SIGMETRICS, 2002.

Similar presentations


Presentation on theme: "1 Error-Free Garbage Collection Traces: How to Cheat and Not Get Caught ACM SIGMETRICS, 2002."— Presentation transcript:

1 1 Error-Free Garbage Collection Traces: How to Cheat and Not Get Caught ACM SIGMETRICS, 2002

2 2 Outline Introduction - Perfect trace vs Granulated trace - Motivation and Contributions The effect of trace granularity in GC simulation Merlin algorithm Conclusions

3 3 Introduction To explore GC algorithms, researchers are using simulation based on traces of allocation and lifetime behavior. - Perfect traces - Generated by brute force method at every potential GC point; - Time consuming ; - Can obtain the accurate information. - Granulated traces (Commonly used) - Generated periodically; - The information in the trace may not be accurately (over-estimate live objects, under-estimate dead objects)

4 4 Introduction GC researchers are discussing a standard file format to enable sharing of traces www.cs.purdue.edu/homes/ hosking/ismm2000/papers/chilimbi.pdf

5 5 Motivation and Contributions Researchers have not studied the effects of granularity on GC simulations. This paper will show that granularity will significantly affect the results. This paper proposed the Merlin trace generation algorithm to produce perfect traces very efficiently (800 faster than the brute force method). The paper suggests a new requirement for the standard trace format: including the granularity level in the trace (or recording the time in the trace).

6 6 The Effect of Granularity We use several sets of experiments to prove the following claim: The granularity traces produce significantly different results from perfect traces. The result suggests a new requirement for any standard trace format: that it should include additional information on granularity of the trace.

7 7 The Effect of Granularity (contd.) Experimental Design - Objective: compare the difference btw the result based on perfect traces and the result based on granulated traces. - Two components: generator is used to generate a granulated trace with the targeted level of granularity; GC simulator is the implementation of a GC algorithm. GC Simulator Generator Granularity level Perfect trace Difference Granularity trace

8 8 The Effect of Granularity (contd.) Settings and parameters - GC simulator. We use four different copying GC algorithms: - a semi-space collector, - a fixed nursery generational collector, - a variable-sized nursery generational collector, - an old-first collector; - Granularity level. It ranges from 1kB to 32kB. - Metrics. We use the following metrics to compare the result of perfect traces and granulated traces: - the number of collections invoked, - the mark/sweep ratio, - the number of interesting stores.

9 9 The Effect of Granularity (contd.) Conclusions of the experiment: - The trace granularity has a significant impact on the simulated results of garbage collection algorithms. - When using traces to compare and measure new GC algorithms and optimizations, there is not a clear way to use granulated traces and have confidence that the results are valid.

10 10 Merlin Trace Generation Previous experiment indicated that it is not a good way to use granulated traces. But it is very time-consuming to generate perfect traces via using brute force method. So, we propose the new Merlin algorithm. Merlin is a wizard in Arthurian legend, who was born as an old man and then lived backwards in time.

11 11 Merlin Algorithm Overview The Merlin algorithm computes when objects were last reachable. To find when objects was last reachable, we stamp the current time whenever they may transition from reachable to unreachable. At each GC points, we can compute exactly when the unreachable objects were last reachable.

12 12 Merlin Details Three steps: 1.Finding potential last reachable times; 2.Computing when objects become unreachable; 3.Computing death times.

13 13 Finding Potential Last Reachable Times Incoming references: Case 1: 1 -> 0; (A, B) Case 2: n -> n-1; (C) Case 3: Stay unchanged. (D, E, F)

14 14 Compute when Objects become unreachable Take advantage of write barrier. - write barrier is capable of reference counting; - Timestamp of each object is overwritten each time its reference is decremented. Use GC to check if an object is reachable.

15 15 Computing Death Times t0 < t1 < t2 < t3 Use depth-first algorithm to compute the full transitive closure sets.

16 16 Experimental Result

17 17 Conclusions Granularity traces produce results that are significantly different from those produced by perfect traces. We introduce the Merlin algorithm to generate perfect traces efficiently.


Download ppt "1 Error-Free Garbage Collection Traces: How to Cheat and Not Get Caught ACM SIGMETRICS, 2002."

Similar presentations


Ads by Google