Mark-Compact Sweep Garbage Collection - PowerPoint PPT Presentation

About This Presentation
Title:

Mark-Compact Sweep Garbage Collection

Description:

Mark-Compact Sweep Garbage Collection & Automatic Heap Resizing: A Valuable ... What combination of heap size and garbage collection will increase performance? ... – PowerPoint PPT presentation

Number of Views:340
Avg rating:3.0/5.0
Slides: 17
Provided by: nadineshi
Learn more at: https://www3.nd.edu
Category:

less

Transcript and Presenter's Notes

Title: Mark-Compact Sweep Garbage Collection


1
Mark-Compact Sweep Garbage Collection
Automatic Heap Resizing A Valuable Combination
2
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
Problem with Heap Sizes
Small heap
Large Heap
4
Problem with Mark Sweep Garbage Collection
Garbage Live Live Garbage Live
(a) Before Collection
Live Live Live
(b) After Collection
5
The Solution
  • Run the Dacapo Suite and GCBench benchmarks on
    the Jikes RVM using several different
    configurations
  • MSwithHR
  • MSwithoutHR
  • MSCwithHR
  • MSCwithoutHR
  • NOGCwithHR

6
Benchmarks (Dacapo Suite)
Benchmark Description
Antlr parses one or more grammar files and generates a parser and lexical analyzer for each.
Fop takes an XSL-FO file, parses it and formats it, generating a PDF file.
Jython interprets a series of Python programs
Pmd analyzes a set of Java classes for a range of source code problems
Ps reads and interprets a PostScript file
7
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
Heap Resizing Algorithm
0 0 0.1 0.3 0.6 0.8 1
0 0.9 0.9 0.95 1 1 1
0.02 0.9 0.9 0.95 1 1 1
0.05 0.95 0.95 1 1 1 1
0.15 1 1 1.1 1.15 1.2 1.2
0.3 1 1 1.2 1.25 1.35 1.3
0.5 1 1 1.25 1.3 1.5 1.5
1 1 1 1.25 1.3 1.5 1.5
  • 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

9
Results (GCBench)
10
Results (fop)
11
Garbage Collection Results
12
Garbage Collection Results
13
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
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
Conclusions
  • While the amount of time spent in garbage
    collection and heap resizing varies in cases in
    which the programs footprint is much smaller
    than the maximum heap size, both amount
    approximately to the same execution times

16
Questions??
Write a Comment
User Comments (0)
About PowerShow.com