1 / 21

Age-Based Garbage Collection

Age-Based Garbage Collection. Darko Stefanović, Kathryn McKinley, J. Eliot B. Moss OOPSLA ‘99 CS395T: Hadi Esmaeilzadeh February 2009. Outline. Scavenging Generational Copying Collection (YO) Runtime Overheads Older-First (OF) Write Barrier and Heap Organization Contributions

elisa
Download Presentation

Age-Based Garbage Collection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Age-Based Garbage Collection Darko Stefanović, Kathryn McKinley, J. Eliot B. Moss OOPSLA ‘99 CS395T: Hadi Esmaeilzadeh February 2009

  2. Outline • Scavenging • Generational Copying Collection (YO) • Runtime Overheads • Older-First (OF) • Write Barrier and Heap Organization • Contributions • Statistics

  3. Scavenging • U={regions not collected}; assumed live • C={regions collected} • S={Survivors} • G={Garbage}; copied/compacted • Work proportional to |S| • Copying • Pointer-tracking • What is the ideal case? • What is the best heuristic?

  4. Youngest-Only (YO) • Intuition: Mortality rate is higher among young objects :((! • Let C={Young objects} • Objective: Minimize |S| • Fewer survivors • Copy less • Track less

  5. Runtime Overheads • Copying the survivors • Tracking the pointers crossing the boundaries • In this case, only old-to-young pointers • Write barrier (interleaving pointer-tracking with program execution) • Cache: The place program and GC collide! • Where is the trade-off?

  6. Runtime Overheads: Early Tenuring (Promotion) • Newly objects are promoted • … What a shame! They die! • Waste of time, space, … • What else?

  7. Why Generational CollectionWorks Well Young objects die more quickly than old objects “generational hypothesis” [Unger’84,Hayes’91] Most pointers are from younger to older objects [Appel’89, Zorn’90] Do they apply to object oriented programs? Kathryn’s

  8. Older-First Garbage Collection • Many objects die when they are middle age! • Give the poor young objects a chance to live!

  9. Older-First Garbage Collection Youngest Oldest Heap window Collection 1 survivors Collection 2 window survivors window Collection 3 survivors Kathryn’s

  10. The Sweet Spot

  11. Design Decisions • Sliding window determines C (Collection region) • What is the design decision? • What is the trade-off? • Other alternatives? • Window hits the allocation point • Collect/compact objects • Reset the window to the oldest objects • What is the design decision? • What is the trade-off? • Other alternatives? • Degree of freedom or added complexity? • Who can help?

  12. Write Barrier: Pointer Filtering for Older-First Runtime pointer direction filtering • Do not record • Pointers within the same block • Pointers with source collected before target • How can architecture help? allocation oldest next collection youngest stored pointer, no store Kathryn’s

  13. Trace Based Measurements Fully accurate traces • All pointers between objects • Precise object life times (collect after every allocation) Measured costs • Copying • Write barrier • Remembered set processing Unmeasured effects • Cache / locality interactions • Startup What is the net speedup? Kathryn’s

  14. Total Cost JavaBYTEmark Kathryn’s

  15. Total Cost Richards (Smalltalk)

  16. Total Cost Bloat-Bloat Kathryn’s

  17. Contributions • More accurate explanations of generational collection (My favorite :))! • Significant reduction in copying cost, by trading off pointer maintenance costs • New write barrier mechanisms • New promising algorithm Kathryn’s

  18. Citation Statistics • ACM portal: 28 • Google scholar: 61 • Narendran Sachindran , J. Eliot , B. Moss, Mark-copy: fast copying GC with less space overhead, ACM SIGPLAN Notices, v.38 n.11, November 2003 • Feng Xian , Witawas Srisa-an , Hong Jiang, Allocation-phase aware thread scheduling policies to improve garbage collection performance, Proceedings of the 6th international symposium on Memory management, October 21-22, 2007, Montreal, Quebec, Canada • Sebastien Marion , Richard Jones , Chris Ryder, Decrypting the Java gene pool, Proceedings of the 6th international symposium on Memory management, October 21-22, 2007, Montreal, Quebec, Canada • William D. Clinger , Fabio V. Rojas, Linear combinations of radioactive decay models for generational garbage collection, Science of Computer Programming, v.62 n.2, p.184-203, 1 October 2006 • Feng Xian , Witawas Srisa-an , Hong Jiang, Garbage collection: Java application servers' Achilles heel, Science of Computer Programming, v.70 n.2-3, p.89-110, February, 2008

  19. Resources • Ben Wiedermann’s presentation in 2003 class • Improving Memory Performance for Java, Kathryn McKinley, CRA-W Distinguished Lecture, ECE CMU, 2000, http://amp.ece.cmu.edu/eceseminar/2000/Fall/Abstract/F00_McKinley.htm

  20. Youngest Only GC Youngest Oldest Heap window Collection 1 uncollected survivors window Collection 2 uncollected survivors

  21. Generational GC with 2 Generations Youngest nursery Oldest Heap window Collection 1 reserve uncollected from reserve survivors freed uncollected window Collection 2 reserve from reserve survivors freed window Collection 3 reserve

More Related