Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination.

Similar presentations


Presentation on theme: "Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination."— Presentation transcript:

1 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination

2 Cindy Nikolai Nadine Shillingford The Problem Processes require different heap sizes Mark sweep garbage collectors have some disadvantages What combination of heap size and garbage collection will increase performance?

3 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Problem with Heap Sizes Small heap Large Heap

4 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Problem with Mark Sweep Garbage Collection GarbageLive GarbageLive (a) Before Collection Live (b) After Collection

5 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford The Solution Run the Dacapo Suite and GCBench benchmarks on the Jikes RVM using several different configurations:  MSwithHR  MSwithoutHR  MSCwithHR  MSCwithoutHR  NOGCwithHR

6 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Benchmarks (Dacapo Suite) BenchmarkDescription Antlrparses one or more grammar files and generates a parser and lexical analyzer for each. Foptakes an XSL-FO file, parses it and formats it, generating a PDF file. Jythoninterprets a series of Python programs Pmdanalyzes a set of Java classes for a range of source code problems Psreads and interprets a PostScript file

7 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Benchmarks (GCBench) focuses on modeling allocation requests in ways that are especially stressful to memory objects are allocated to create trees of differing heights and sizes.

8 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Heap Resizing Algorithm Calculate the live ratio (amount of memory in use/current heap size) Calculate heap change ratio  How much garbage collection has been done?  Calculate heap change ratio based on live ratio, GC Load and function matrix New size = old heap size * heap change ratio If new size != old size  Change the heap size  Inform VM that the heap size has changed 000.10.30.60.81 00.9 0.95111 0.020.9 0.95111 0.050.95 1111 0.15111.11.151.2 0.3111.21.251.351.3 0.5111.251.31.5 1111.251.31.5

9 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Results (GCBench)

10 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Results (fop)

11 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Garbage Collection Results

12 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Garbage Collection Results

13 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Conclusions The variation of mark compact sweep implemented in the Jikes RVM works just as well as the basic mark sweep algorithm, even in the face of compaction and when complemented with automatic heap resizing In some cases, we need to examine the application itself to determine which algorithm is better suited for our needs.

14 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Conclusions Only using garbage collection gives worse performance than choosing heap resizing in conjunction with garbage collection in situations in which we do not have adequate memory to execute our entire program Only using heap resizing gives worse performance in situations in which the footprint of the application is much smaller than the maximum heap size. In these situations, a conjunction of heap resizing with automatic garbage collection gives the best performance

15 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Conclusions While the amount of time spent in garbage collection and heap resizing varies in cases in which the program’s footprint is much smaller than the maximum heap size, both amount approximately to the same execution times

16 Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination Cindy Nikolai Nadine Shillingford Questions??


Download ppt "Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable Combination."

Similar presentations


Ads by Google