SlideShare une entreprise Scribd logo
1  sur  47
Mark – Sweep Algorithm
 first algorithm for automatic storage
  reclamation (McCarthy 1960).
 a stop and run algorithm.
 tracing garbage collection technique
 works in 2 Phases:
           – mark all live nodes by traversal.
           – sweep the heap by a linear scan.




                                                 1
Mark-Sweep Algorithm
Benefits:
a) No overhead on pointer manipulations.
b) Low space cost: using a simple mark-
   field/bit.
Drawbacks:
a) Computation halted while gc
b) Every cell is visited during marking
c) Cells are again re-examined by sweep
d) Recursive marking (time and space!)
                                           2
Mark -- Sweep Algorithm
   Each block or its corresponding book keeping
    must contain bit (mark bit)
   Initially all blocks are unmarked
   Starting at each symbol perform a search marking
    all blocks reachable (mark means in-use)
   Sweep through all blocks.
    – If marked: Unmark
    – If unmarked: move to free list ( i.e free it )
   Note: Algorithm must be only thing running
   Garbage collection is only done when necessary
    – i.e. When free list is empty
                                                       3
Characteristics of Mark and Sweep
                Algorithm
   Can place an upper bound on the total amount of
    time required to perform complete GC. Use this
    to pace GC against ongoing allocation needs.

   No “time intrusive” overheads to interfere with
    calculation of worst-case task execution times.

   But cannot guarantee to avoid fragmentation.


                                                      4
Consider the following
Arrangement of nodes

          Internally
    X                       ()


        foo         blarg

                            ()


              bar    baz

    Y                       ()


        foo   bar    baz
                                 5
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                                6
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                                7
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                                8
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                                9
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               10
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               11
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               12
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               13
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               14
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               15
Free
                                             Mark
                 Free List
X
           ()                         ()




Y

     ()     ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               16
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               17
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               18
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               19
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               20
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               21
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               22
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               23
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               24
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               25
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()
                      Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.

                                               26
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               27
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               28
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               29
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               30
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               31
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               32
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               33
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               34
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               35
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               36
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               37
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               38
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               39
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               40
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               41
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               42
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               43
Sweep
    Free
                 Free List
X
           ()                         ()




Y

            ()        Here , X and Y correspond to
                      the root Pointers and the
                      block pointed to by “Free”
                      Corresponds to the Free List.


                                               44
Sweep
    Free
                 Free List
X
           ()                           ()




Y

            ()          Here , X and Y correspond to
                        the root Pointers and the
                        block pointed to by “Free”
                        Corresponds to the Free List.


                   ()                            45
Done
    Free
                 Free List
X
           ()                           ()




Y

            ()          Here , X and Y correspond to
                        the root Pointers and the
                        block pointed to by “Free”
                        Corresponds to the Free List.


                   ()                            46
As Simple as ......




                      47

Contenu connexe

Dernier

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 

Dernier (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Mark and sweep algorithm(garbage collector)

  • 1. Mark – Sweep Algorithm  first algorithm for automatic storage reclamation (McCarthy 1960).  a stop and run algorithm.  tracing garbage collection technique  works in 2 Phases: – mark all live nodes by traversal. – sweep the heap by a linear scan. 1
  • 2. Mark-Sweep Algorithm Benefits: a) No overhead on pointer manipulations. b) Low space cost: using a simple mark- field/bit. Drawbacks: a) Computation halted while gc b) Every cell is visited during marking c) Cells are again re-examined by sweep d) Recursive marking (time and space!) 2
  • 3. Mark -- Sweep Algorithm  Each block or its corresponding book keeping must contain bit (mark bit)  Initially all blocks are unmarked  Starting at each symbol perform a search marking all blocks reachable (mark means in-use)  Sweep through all blocks. – If marked: Unmark – If unmarked: move to free list ( i.e free it )  Note: Algorithm must be only thing running  Garbage collection is only done when necessary – i.e. When free list is empty 3
  • 4. Characteristics of Mark and Sweep Algorithm  Can place an upper bound on the total amount of time required to perform complete GC. Use this to pace GC against ongoing allocation needs.  No “time intrusive” overheads to interfere with calculation of worst-case task execution times.  But cannot guarantee to avoid fragmentation. 4
  • 5. Consider the following Arrangement of nodes Internally X () foo blarg () bar baz Y () foo bar baz 5
  • 6. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 6
  • 7. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 7
  • 8. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 8
  • 9. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 9
  • 10. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 10
  • 11. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 11
  • 12. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 12
  • 13. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 13
  • 14. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 14
  • 15. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 15
  • 16. Free Mark Free List X () () Y () () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 16
  • 17. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 17
  • 18. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 18
  • 19. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 19
  • 20. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 20
  • 21. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 21
  • 22. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 22
  • 23. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 23
  • 24. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 24
  • 25. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 25
  • 26. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 26
  • 27. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 27
  • 28. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 28
  • 29. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 29
  • 30. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 30
  • 31. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 31
  • 32. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 32
  • 33. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 33
  • 34. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 34
  • 35. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 35
  • 36. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 36
  • 37. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 37
  • 38. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 38
  • 39. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 39
  • 40. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 40
  • 41. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 41
  • 42. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 42
  • 43. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 43
  • 44. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. 44
  • 45. Sweep Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. () 45
  • 46. Done Free Free List X () () Y () Here , X and Y correspond to the root Pointers and the block pointed to by “Free” Corresponds to the Free List. () 46
  • 47. As Simple as ...... 47