Specialized Reference Counting Garbage Collection using Data Structure Annotations - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Specialized Reference Counting Garbage Collection using Data Structure Annotations

Description:

Specialized Reference Counting Garbage Collection using Data Structure Annotations ... If the user forgets to remove the secondary reference, the Bug won't be deleted. ... – PowerPoint PPT presentation

Number of Views:121
Avg rating:3.0/5.0
Slides: 19
Provided by: acade119
Category:

less

Transcript and Presenter's Notes

Title: Specialized Reference Counting Garbage Collection using Data Structure Annotations


1
Specialized Reference Counting Garbage Collection
using Data Structure Annotations
  • By Eric Watkins and Dzin Avots
  • for CS 343 Spring 2002

2
Motivation
  • Improve use of ref counting for C
  • Problem cycles cant be freed automatically,
    expensive to determine what is unreachable
  • Solution Use user specified data structure
    annotations to improve performance

3
Goals Techniques
  • Avoid unnecessary mark sweeps
  • Acyclic Data Structure Optimizations
  • Avoid some memory leaks
  • Reference Removal Invariant Model

4
Reference Counting using Smart Pointers
5
Garbage Example 1
  • Doubly Linked List
  • Everything is strongly connected
  • Nothing can be freed until all external refs are
    gone
  • How can we recognize this data structure?

ext ptr
ext ptr
6
Abstract Description of Data Structures
  • The compiler cant differentiate these two even
    though they will obviously be connected in
    different ways.
  • ADDS can tell us how to customize smart pointer
    usage for certain data structures

7
Doubly Linked List ADDS
8
Binary Tree w/ Parents ADDS
9
ADDS spec
  • Dimensions (1-d, 2-d, etc.)
  • Directionality (forward and backward)
  • Uniqueness of forward references (DAGs vs. lists)
  • Cyclicity

10
Linked List Optimization
  • The entire dimension is strongly connected,
    forwards and backwards
  • Summarize with single ref counter for all
    external references to dimension

11
Dimensional Independence
  • Dimensions X and Y are dependent if one traversal
    along X and another traversal along Y may lead to
    a common node by different paths

12
Other ADDS issues
  • What about describing relations between different
    acyclic data structures?
  • Could avoid marking sweeping this structure

etc.
13
Primary Secondary Pointers
  • Primary pointers if these point to an object,
    then object is still in use
  • Secondary pointers point to object, but dont
    affect use status
  • Memory leak Primary pointers are all removed,
    but a secondary pointer remains

14
Garbage Example 2
BugManager
Grid
Secondary refs
Primary refs
Bug
Bug
  • Programs can contain complicated, interconnected
    relationships between objects

15
Garbage Example 2
BugManager
Grid
Secondary refs
Primary ref
Bug
Bug
  • If the user forgets to remove the secondary
    reference, the Bug wont be deleted.

16
Primary Secondary Pointers
  • User specifies primary secondary pointers in
    ADDS specification
  • Primary Secondary pointer invariant can be
    expressed as instrumentation predicate in
    3-valued logic
  • Generate shape analysis to detect leak condition

17
Plan of Action
  • Investigate use of ADDS specs to improve refcount
    performance
  • Generate interprocedural shape analysis from
    primary secondary edge specs
  • Look into other improvements from user
    specifications

18
Related Work
  • ADDS work L. Hendren and J. Hummel, Abstractions
    for Recursive Pointer Data Structures Improving
    the Analysis and Transformation of Imperative
    Programs
  • Shape Analysis M. Sagiv, T. Reps and R. Wilhelm,
    Parametric Shape Analysis via 3-Valued Logic
Write a Comment
User Comments (0)
About PowerShow.com