MOSTLY PARALLEL GARBAGE COLLECTION - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

MOSTLY PARALLEL GARBAGE COLLECTION

Description:

MOSTLY PARALLEL GARBAGE COLLECTION Authors : Hans J. Boehm Alan J. Demers Scott Shenker XEROX PARC Presented by:REVITAL SHABTAI – PowerPoint PPT presentation

Number of Views:149
Avg rating:3.0/5.0
Slides: 25
Provided by: nice154
Category:

less

Transcript and Presenter's Notes

Title: MOSTLY PARALLEL GARBAGE COLLECTION


1
MOSTLY PARALLEL GARBAGE COLLECTION
  • Authors Hans J. Boehm
  • Alan J. Demers
  • Scott Shenker
  • XEROX PARC
  • Presented byREVITAL SHABTAI

2
Introduction
  • A method for adapting garbage collectors designed
    to run sequentially with the client.

3
Overview
  • Problem introduction
  • Basic idea
  • Method components
  • Implementation choices
  • Empirical results
  • Conclusions

4
Garbage Collectors Styles
  • Two basic styles of garbage collection
    algorithms 1.Reference-counting
    collector 2.Tracing collector

5
Traditional Tracing
  • A set of root memory objects -always accessible
  • Mark - performing reachability from the roots
    and marking the accessible objects
  • Sweep - reclaiming unmarked objects

6
The Problem
  • A straightforward implementation prevents any
    client action while tracing (stop-the-world)
  • Sometimes the tracing is an intolerable long
    pause
  • Two approaches to reduce pause times of tracing
    collectors 1.Generational collectors
    2.Parallel collectors

7
The Basic Idea
  • Most of the tracing algorithm runs in parallel
    with the client
  • Small portion of the tracing is done during
    stop-the-world action
  • Relying on virtual memory information about pages
    that have been updates during a given period of
    time

8
The Parallel Method
  • Define a set of dirty bits for a set of virtual
    pages
  • Clear all virtual dirty bits
  • Perform a parallel tracing
  • Update the dirty bits to reflect client writes
  • Stop-the-world and trace from all marked objects
    that lie on dirty pages
  • Reclaim unreachable (unmarked) objects

9
Method - Comments
  • The parallel tracing phase provides an
    approximation to the true reachable set
  • The stop-the-world tracing phase provides a full
    complete set of the reachable objects
  • The duration of the final stop-the-world phase is
    related to the number of pages written during the
    parallel collection

10
Method -Comments 2
  • Not all unreachable objects are reclaimed, but
    will be reclaimed by a subsequent collection
  • Copying collectors (moving objects) require a
    more careful treatment

11
The Mark Phase
  • Split the heap into blocks
  • In each block objects of the same size
  • A block size is the a physical page
  • Set a bit for each accessible object
  • Queue pages for sweeping in a separate queue for
    each object size

12
The Sweep Phase
  • Done with object allocation (not during a
    stop-the-world)
  • The allocator keeps a free lists for each object
    size
  • If an empty free list is found
  • Sweep the first page in the queue
  • Remove the page from the queue
  • Restore unreachable objects from this page to the
    free list

13
Consequences
  • Worst case of mark phase duration is as in the
    non-parallel tracing
  • Worst case of allocating objects is when full
    pages are scanned in order to find free
    objects
  • In practice both are not noticeable

14
Partial Collector - Formal Definitions
  • Partial Collector - a collector that reclaims
    only a subset of all unreachable objects
  • A set T (threatened) - potentially collectible
    objects
  • A set I (immune) - the non-collectible objects

15
Formal Statements
  • C Every object in I is marked and every object
    pointed to by a marked object is also marked
  • TR Mark all objects in I and trace from them
  • F Trace from all marked objects on dirty pages

16
Stop the mostly world
parallel
  • Stop the world
  • Clear all mark bits
  • Perform TR
  • Restart the world
  • Clear all mark bits
  • Clear all virtual dirty bits
  • Perform TR
  • Stop the world
  • Perform F
  • Restart the world

Condition C holds
Condition C does not hold
C Every object in I is marked and every object
pointed to by a marked object on a clean page is
also marked
17
Reducing the stop-the-world Delay
  • M - Atomically clear the virtual dirty bits from
    the pages P, and trace from the marked objects on
    the dirty pages of P.
  • A Partial Generational Mostly Parallel
    Collection 1.Perform M on the heap 2.Stop
    the world 3.Perform F 4.Restart the
    world

18
Reducing the stop-the-world Delay- Version 2
  • M 1.Atomically clear the dirty bits from
    the pages P 2.For all marked objects
    pointed to by marked objects on dirty pages of P
    mark them and dirty the pages on which they
    reside

19
Implementation Choices
  • Repeated applications of M instead of a single
    application of M
  • Run M more that once before a partial collection
  • Further variants of M are possible (such as M
    mark from other sets)
  • When to run a full collection? When to expand
    the heap?
  • How to control the scheduling of the client
    and collector threads

20
Empirical Results
21
Mostly Parallel Copying Collectors
  • For each object, additional space is required for
    forwarding links
  • The collector copies from from-space to to-space
    and update the forwarding links

22
Mostly Parallel Copying Collector Implementation
  • Additions to the copying collector 1.Clear the
    forwarding links 2.Update dirty pages
    bits 3.Update forwarding links
  • In the stop-the-world phase for any object O that
    lie on dirty page 1.Copy any object O points
    at 2.Update pointers in copies 3.Copy O and
    update its fields

23
Conclusion
  • Mostly parallel partial generational tracing
    collector that run sequentially with the client
  • Various implementation choices for various cases
  • Reduced the stop-the-world phase time duration

24
THE END
Write a Comment
User Comments (0)
About PowerShow.com