Naming CSCI 6900/4900. Unreferenced Objects in Dist. Systems Objects no longer needed as nobody has a reference to them and hence will not use them Garbage.

Slides:



Advertisements
Similar presentations
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Advertisements

(Chapter 5) Deleting Objects
Rasool Jalili, OS2, Sem Naming Chapter 4. Rasool Jalili, OS2, Sem Advertisment!! Please inform the students to subscribe to the mailing.
Process Synchronization. Module 6: Process Synchronization Background The Critical-Section Problem Peterson’s Solution Synchronization Hardware Semaphores.
Garbage Collection Introduction What is garbage and how can we deal with it? Garbage collection schemes Reference Counting Mark and Sweep Stop and Copy.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Garbage Collection What is garbage and how can we deal with it?
Garbage Collecting the World Bernard Lang Christian Queinnec Jose Piquer Presented by Yu-Jin Chia See also: pp text.
Garbage Collecting the World. --Bernard Lang, Christian and Jose Presented by Shikha Khanna coen 317 Date – May25’ 2005.
Bounding Space Usage of Conservative Garbage Collectors Ohad Shacham December 2002 Based on work by Hans-J. Boehm.
Garbage Collecting the World: One Car at a Time Richard L. Hudson, Ron Monison,~ J. Eliot B. Moss, & David S. Munrot Department of Computer Science, University.
Garbage Collection  records not reachable  reclaim to allow reuse  performed by runtime system (support programs linked with the compiled code) (support.
O N T HE F LY G ARBAGE C OLLECTOR Edger W. Dijkstra Leslie Lamport A. J. Martin C. S. Scholten E.F.M. Steffens Presented by: Dana Drachsler 1.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
On-the-Fly Garbage Collection: An Exercise in Cooperation Edsget W. Dijkstra, Leslie Lamport, A.J. Martin and E.F.M. Steffens Communications of the ACM,
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
Dr. Kalpakis CMSC621 Advanced Operating Systems Naming.
Parallel Garbage Collection Timmie Smith CPSC 689 Spring 2002.
Mark and Sweep Algorithm Reference Counting Memory Related PitFalls
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
Memory Management. History Run-time management of dynamic memory is a necessary activity for modern programming languages Lisp of the 1960’s was one of.
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Remote Object Invocation
Naming Chapter 4. Names, Addresses, and Identifiers Name: String (of bits/characters) that refers to an entity (e.g. process, file, device, …) Access.
Naming in Distributed System Presented by Faraz Rasheed & Uzair Ahmed RealTime & Multimedia Lab Kyung Hee University, Korea.
MOSTLY PARALLEL GARBAGE COLLECTION Authors : Hans J. Boehm Alan J. Demers Scott Shenker XEROX PARC Presented by:REVITAL SHABTAI.
Memory Allocation and Garbage Collection. Why Dynamic Memory? We cannot know memory requirements in advance when the program is written. We cannot know.
Compilation 2007 Garbage Collection Michael I. Schwartzbach BRICS, University of Aarhus.
The environment of the computation Declarations introduce names that denote entities. At execution-time, entities are bound to values or to locations:
1 An Efficient On-the-Fly Cycle Collection Harel Paz, Erez Petrank - Technion, Israel David F. Bacon, V. T. Rajan - IBM T.J. Watson Research Center Elliot.
Damien Doligez Georges Gonthier POPL 1994 Presented by Eran Yahav Portable, Unobtrusive Garbage Collection for Multiprocessor Systems.
Reference Counters Associate a counter with each heap item Whenever a heap item is created, such as by a new or malloc instruction, initialize the counter.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
SEG Advanced Software Design and Reengineering TOPIC L Garbage Collection Algorithms.
10.4 How to Find a Perfect Matching We have a condition for the existence of a perfect matching in a graph that is necessary and sufficient. Does this.
Naming Chapter 4. Name Spaces (1) A general naming graph with a single root node.
Storage Management. The stack and the heap Dynamic storage allocation refers to allocating space for variables at run time Most modern languages support.
+ Simulation Design. + Types event-advance and unit-time advance. Both these designs are event-based but utilize different ways of advancing the time.
Naming (1) Chapter 4. Chapter 4 topics What’s in a name? Approaches for naming schemes Directories and location services Distributed garbage collection.
CSC 213 – Large Scale Programming. Today’s Goals  Consider what new does & how Java works  What are traditional means of managing memory?  Why did.
1 Real-Time Replication Garbage Collection Scott Nettles and James O’Toole PLDI 93 Presented by: Roi Amir.
Incremental Garbage Collection Uwe Kern 23. Januar 2002
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
More on Adaptivity in Grids Sathish S. Vadhiyar Source/Credits: Figures from the referenced papers.
Garbage Collection and Memory Management CS 480/680 – Comparative Languages.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
More Distributed Garbage Collection DC4 Reference Listing Distributed Mark and Sweep Tracing in Groups.
G ARBAGE C OLLECTION CSCE-531 Ankur Jain Neeraj Agrawal 1.
CSC 213 – Large Scale Programming. Explicit Memory Management  Traditional form of memory management  Used a lot, but fallen out of favor  malloc /
® July 21, 2004GC Summer School1 Cycles to Recycle: Copy GC Without Stopping the World The Sapphire Collector Richard L. Hudson J. Eliot B. Moss Originally.
CS412/413 Introduction to Compilers and Translators April 21, 1999 Lecture 30: Garbage collection.
Reference Counting. Reference Counting vs. Tracing Advantages ✔ Immediate ✔ Object-local ✔ Overhead distributed ✔ Very simple Trivial implementation for.
Naming Chapter 4. Table of Contents Concepts Locate mobile entities Garbage collection.
Garbage Collecting the World Presentation: Mark Mastroieni Authors: Bernard Lang, Christian Queinne, Jose Piquer.
Object Lifetime and Pointers
Garbage Collection What is garbage and how can we deal with it?
Storage Management.
Concepts of programming languages
Garbage Collection Modern programming languages provide garbage collection mechanisms for reclaiming the memory locations that are no longer used by programs.
Naming Chapter 4.
Naming A name in a distributed system is a string of bits or characters used to refer to an entity. To resolve name a naming system is needed.
Cycle Tracing Chapter 4, pages , From: "Garbage Collection and the Case for High-level Low-level Programming," Daniel Frampton, Doctoral Dissertation,
Naming (1) Chapter 4.
Lectures on Graph Algorithms: searching, testing and sorting
Naming in Distributed System
Chapter 12 Memory Management
Reference Counting.
Garbage Collection What is garbage and how can we deal with it?
Presentation transcript:

Naming CSCI 6900/4900

Unreferenced Objects in Dist. Systems Objects no longer needed as nobody has a reference to them and hence will not use them Garbage collection is necessary as objects consume resources In non-distributed systems garbage collection is much simpler than distributed systems Cross machine references, transitive references, references as parameters complicate matters Objects referencing recursively but not by anyone else

The Problem of Unreferenced Objects An example of a graph representing objects containing references to each other.

Reference Counting The problem of maintaining a proper reference count in the presence of unreliable communication. Counting the number of references of an object Simple reference counting works well for uni-processor systems, but encounters problems for distributed systems

Copying References Across Processes a)Copying a reference to another process and incrementing the counter too late b)A solution. Race conditions can easily arise Need careful design to overcome the problems

Weighted Reference Counting a)The initial assignment of weights in weighted reference counting b)Weight assignment when creating a new reference. Designed to overcome race conditions of simple reference counting Each object has a fixed total weight When a remote reference is created, half the weight is assigned to the new reference Object can be safely removed when the weight becomes zero

Weighted Reference Counting - 2 When a copy is created of a remote reference, the new copy receives half the weight When a reference is deleted, its current weight is subtracted Object can be safely removed when the weight becomes zero

Indirection in Weighted Referencing Creating an indirection when the partial weight of a reference has reached 1.

Generation Reference Counting Each proxy stores two numbers –A counter indicating the number of times the proxy has been copied –A generation number indicating how the proxy was created Original skeleton maintains info. about copies for each generation When a proxy is removed the original skeleton is informed about the generation number and number of copies

Reference Listing All the above approaches assume reliable communication Idempotent Operations – can be repeated safely without affecting the end result –Results depend on whether an operation has been invoked at all How to make adding deleting references idempotent? –Maintain an explicit list of references rather than counter –Check for duplicates when performing operation

Identifying Unreachable Entities Reference counting and listing cannot deal with unreachable entities with recursive referencing Need techniques to check all entities for unreachability – Tracing based garbage collection Mark & Sweep Collectors –Mark phase: Entities are traced from root set and marked –Sweep phase: Examine all entities and remove unmarked –Three coloring approach –Each entity is initially white –Entity is gray if found reachable but references need to be explored –Mark it black if reachable and explored completely –All white nodes are unreachable and can be removed

Distributed Mark & Sweep Each process starts a local garbage collector –These garbage collectors run in parallel Proxies, skeletons and objects are colored Initially all proxies, skeletons and objects are white When an object residing in process P is reachable from a root in P, it is marked grey –All proxies in the object are marked grey When a proxy is marked grey, its skeleton is marked grey, which in turn marks the associated object grey Local garbage collectors collect white objects Un-scalable and requires reachability graph to remain unchanged – STOP & GO approach

Tracing in Groups Designed to deal with the scalability issue Processes are organized into groups for scalability purposes –Group is a collection of processes Combination of Mark & sweep and reference counting Basic idea – collect garbage within each group and then recursively consider larger groups Assumption – Remote references are implemented as proxy-skeleton pair

Steps in Group Tracing 1.Initial Marking – Only skeletons are marked 2.Intra-process propagation – Propagate marks from skeletons to proxies 3.Inter-process propagation – Proxies to skeletons 4.Stabilization – repeat two steps until stability is reached 5.Garbage reclamation

Marks in Group Tracing Skeletons – Hard or Soft –Hard implies skeleton is reachable from proxy outside the group, or object in rootset of a process –Soft implies reachable only from proxies within the group Proxy – Hard, Soft or None –Hard implies proxy is reachable from object in root set –Soft implies proxy is reachable from skeleton marked as soft –None – Proxy is not reachable from skeleton or proxy in root set

Tracing in Groups (1) Initial marking of skeletons.

Tracing in Groups (2) After local propagation in each process.

Tracing in Groups (3) Final marking.