U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Repaso: Unidad 1 Lección 2
Scenario: EOT/EOT-R/COT Resident admitted March 10th Admitted for PT and OT following knee replacement for patient with CHF, COPD, shortness of breath.
AP STUDY SESSION 2.
1
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Processes and Operating Systems
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Objectives: Generate and describe sequences. Vocabulary:
UNITED NATIONS Shipment Details Report – January 2006.
David Burdett May 11, 2004 Package Binding for WS CDL.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination. Introduction to the Business.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Custom Services and Training Provider Details Chapter 4.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Chapter 6 File Systems 6.1 Files 6.2 Directories
1 Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Break Time Remaining 10:00.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
Red Tag Date 13/12/11 5S.
PP Test Review Sections 6-1 to 6-6
1 The Blue Café by Chris Rea My world is miles of endless roads.
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Chapter 10: Virtual Memory
Bellwork Do the following problem on a ½ sheet of paper and turn in.
Operating Systems Operating Systems - Winter 2012 Chapter 4 – Memory Management Vrije Universiteit Amsterdam.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Chapter 6 File Systems 6.1 Files 6.2 Directories
Copyright © 2013, 2009, 2006 Pearson Education, Inc. 1 Section 5.5 Dividing Polynomials Copyright © 2013, 2009, 2006 Pearson Education, Inc. 1.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
… an introduction Peter Varsanyi Garbage collector Confidential.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Matthew Hertz, Yi Feng, & Emery Berger Department of Computer Science University.
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
Subtraction: Adding UP
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
Speak Up for Safety Dr. Susan Strauss Harassment & Bullying Consultant November 9, 2012.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Converting a Fraction to %
Clock will move after 1 minute
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Murach’s OS/390 and z/OS JCLChapter 16, Slide 1 © 2002, Mike Murach & Associates, Inc.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan.
MC 2 : High Performance GC for Memory-Constrained Environments N. Sachindran, E. Moss, E. Berger Ivan JibajaCS 395T *Some of the graphs are from presentation.
Presentation transcript:

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot B. Moss Emery Berger

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 2 Motivation Handheld Devices: PDAs, cell phones Constrained memory, limited power Run applications with diverse requirements Multimedia, scaled down desktop apps. Java becoming popular on handhelds Safety, portability Garbage collection Require good throughput & low pauses, in constrained memory

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 3 Mark-Sweep Collection Free list allocation First-fit, best-fit, segregated free lists… Does not copy data  Space overhead not very high  Fragmentation: lowers space utilization  Locality effects  Different sizes are segregated  New objects may be interspersed with old

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 4 Mark-(Sweep)-Compact Collection Low space overhead Bump pointer allocation Good throughput in constrained memory Preserves object allocation order Good locality Long pause times

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 5 (Generational) Copying Collection  Bump pointer allocation  Copies data, avoids fragmentation  Reorders objects: can improve locality  Min. space required = 2X live data size

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 6 Mark-Copy Collection: Goal Manages space in old generation Overcome 2X space overhead Better space utilization Generational copying Mark-Copy

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 7 Mark-Copy Space Usage Divides space into equal size windows Reserves one window for copying Collects in two phases: Mark and Copy Generational copying Mark-Copy

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 8 Mark-Copy In Action Nursery Old Generation Unmapped Nursery Old Generation A B C D E F R1R2 Unmapped Nursery Old Generation Unmapped A B C D E F R1R2 G R3 Nursery Old Generation Unmapped A B C D E F R1R2 G H R3 Nursery Old Generation Unmapped A B C D E F R1R2 G H R3 Nursery Old Generation Unmapped A B C D E F R1R2 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 Nursery Old Generation Unmapped A B C D E F R1 G H R3 B Nursery Old Generation Unmapped A B C D E F R1 G H R3 B Nursery Old Generation Unmapped A B C D E F R1 G H R3 B Nursery Old Generation Unmapped A B C D E F R1 G H R3 B Nursery Old Generation Unmapped A B C D E F R1 G H R3 B Nursery Old Generation Unmapped C D E F R1 G H R3 B Unmapped Nursery Old Generation Unmapped C D E F R1 G H R3 B Unmapped Nursery Old Generation Unmapped C D E F R1 G H R3 B Unmapped Nursery Old Generation Unmapped C D E F R1 G H R3 B C D G Unmapped Nursery Old Generation Unmapped R1 R3 B C D G Unmapped Nursery Old Generation Unmapped R1 R3 B C D G Unmapped Nursery Old Generation Unmapped R1 R3 B C D G Unmapped

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 9 Experimental Results Implemented in Jikes RVM (2.2.2)/JMTk Macintosh PPC (533 MHz), 640MB memory, Linux Collectors evaluated Mark-Copy vs. Gen. copy (Appel style) Mark-Copy vs. Mark-Sweep Mark-Copy vs. Gen. Mark-Sweep

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 10 Mark-Copy vs. Gen. Copy

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 11 _213_javac Mark/Cons

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 12 _ 213_javac GC Time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 13 _213_javac Execution Time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 14 Mark-Copy vs. Gen. Mark-Sweep

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 15 _213_javac GC Time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 16 _213_javac Execution Time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 17 Mark-Copy Summary Mark-Copy vs. Gen. copy Runs in less space Outperforms in small and moderate heaps Mark-Copy vs. Mark-Sweep Outperforms non-generational collector in small and moderate size heaps Improves exec. time for some programs when compared with gen. collector

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 18 Mark-Copy Limitations Requires virtual memory support Always copies all live data Potentially large remembered sets Could grow as large as heap Long pauses Non-incremental marking and copying

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 19 MC 2 –Memory Constrained Copying Overcomes mark-copy limitations Removes virtual memory requirement Incremental mark and copy phases Bounded space for remembering

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 20 Removing Use of Memory Mapping Use ‘logical’ instead of object address Every window has a logical address Logical address implies collection order Remset insert requires logical address lookup High occupancy windows moved logically

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 21 Handling Large Remembered Sets Set a limit on the total remset size We use 5% of total heap space Check size regularly, on allocation ‘slow path’ Coarsen large remsets when space close to limit Replace large remsets with card table

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 22 Making Collection Incremental Interleave marking & copying with program (mutator) activity Problem: Mutator could modify object graph between collection increments Could cause reclamation of live objects Solution: Track mutations using write barrier Record mutated slots in remsets at GC time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 23 Making Collection Incremental Popular objects Popular = Highly referenced Cause long pauses when copied MC 2 identifies popular objects while coarsening remset Isolates these objects at high end of heap May cause long pause once, but does not recur

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 24 Incremental Copying Example

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 25 Incremental Copying Example

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 26 Incremental Copying Example

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 27 Incremental Copying Example

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 28 Incremental Copying Example

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 29 Experimental Results Implemented in Jikes RVM (2.2.3)/JMTk Pentium GHz, 512MB memory, RedHat Linux Collectors evaluated Generational Mark-Sweep (MS) Generational Mark-Compact (MSC) MC 2

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 30 Non-incremental Collector Improvements

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 31 JMTk Heap Layout Boot Image Imm. Object Space Large Object Space Old GenerationNursery

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 32 JMTk Generational Collection Write barrier records pointers into the nursery from objects outside the nursery Fast–only two comparisons Nursery collections efficient Full collections scan entire boot image to locate live objects on heap Inefficient for small heaps Scan ~2 million pointers, only 0.4% relevant

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 33 Old write barrier Boot Image Imm. Object Space Large Object Space Old GenerationNursery

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 34 New Write Barrier Records pointers into nursery Also records mutated boot image objects Full collections avoid boot image scan Scan only mutated boot image objects Reduces full GC time (4x for small programs) Efficient for small heaps (reduction in GC time > cost of new write barrier)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 35 New Write Barrier Boot Image Imm. Object Space Large Object Space Old GenerationNursery

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 36 JMTk Heap Data and code allocated in same region Poor code locality  high ITLB miss rate Maintaining separate data and code regions improves locality for copying collectors

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 37 _213_javac (MSC GC Time)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 38 _213_javac (MSC Execution Time)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 39 MC 2 vs. MS and MSC

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 40 jess Execution Time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 41 javac Execution Time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 42 Bounded Mutator Utilization (jess)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 43 Bounded Mutator Utilization (javac)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 44 MC 2 Summary Runs with low space overhead Throughput comparable to MS and MSC Average pause times factor of 4 lower than MS, factor of 7 lower than MSC Suitable for handheld devices with soft real time requirements: Low space overhead Good throughput Short pause times

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 45 The Papers Mark-Copy: OOPSLA 2003 MC 2 : OOPSLA 2004 Naren Sachindran PhD forthcoming