1 / 45

Hippocratic Garbage Collection

Hippocratic Garbage Collection. Matthew Hertz, Yi Feng, & Emery Berger Department of Computer Science University of Massachusetts. Dude, where’s my performance?. Sun HotSpot JDK 1.4.1, Java Beans benchmark. Ever-Steeper Memory Hierarchy. Higher = smaller, faster, closer to CPU

lacey
Download Presentation

Hippocratic 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. Hippocratic Garbage Collection Matthew Hertz, Yi Feng, & Emery Berger Department of Computer Science University of Massachusetts

  2. Dude, where’s my performance? • Sun HotSpot JDK 1.4.1, Java Beans benchmark

  3. Ever-Steeper Memory Hierarchy • Higher = smaller, faster, closer to CPU • A real desktop machine (mine) registers 8 integer, 8 floating-point; 1-cycle latency 8K data & instructions; 2-cycle latency L1 cache L2 cache 512K; 7-cycle latency RAM 1GB; 100 cycle latency Disk 40 GB; 38,000,000 cycle latency (!)

  4. Program Throughput: Ideal vs. Real

  5. GC Pause Time From 55 milliseconds to 30 seconds!..Can we avoid this?

  6. Memory Prices Over Time “Soon it will be free…”

  7. Memory Prices: Inflection Point

  8. Memory Not So Free “Buy more RAM” = “Ferraris for Everyone” Servers: buy 4GB,get 1 CPU free! • Sun E10000:4GB extra = $75,000! • Fast RAM • Cosmic rays… Desktops:most 256MB • 1GB = 50% more $ • Laptops = 70%, if possible 4GB Sun RAM = ½ Ferrari Modena

  9. Fast DDR2 modules today: $500/GB

  10. Outline • Motivation • GC Paging Behavior • Hippocratic Garbage Collection • Cooperation • Bookmarking • Results • Future Work

  11. What’s really going on here?

  12. GC Performance While Paging RAM Hard Disk • GC: Touch evicted page

  13. GC Performance While Paging RAM Hard Disk • VM: brings page in-core

  14. GC Performance While Paging RAM Hard Disk • VM: evicts different page (LRU)

  15. GC Performance While Paging RAM Hard Disk • GC: Touches page on disk

  16. GC Performance While Paging RAM Hard Disk • VM: Evicts another page…and so on…

  17. Oblivious Memory Management • Garbage collection: VM-oblivious • Cannot adjust to changing memory pressure • Touches non-resident pages • Virtual memory: GC-oblivious • Likely to evict pages needed by GC

  18. Outline • Motivation • GC Paging Behavior • Hippocratic Garbage Collection • Cooperation • Bookmarking • Results • Future Work

  19. Our Inspiration As to diseases, make a habit of two things: to help, or at least, to do no harm. Hippocrates

  20. Hippocratic Garbage Collection Garbage collector • Goal: GC triggers no additional paging • Key ideas: • Minimize space consumption • Exploit page information from VM • Residency, eviction notifications • Avoid touching evicted pages Virtual memory manager page eviction notification Page replacement Evacuates pages Selects victim pages victim page(s)

  21. HC Collector Overview • Generational • Focused activity in nursery: improves locality • Mark-sweep (w/o pressure) • Compaction • Shrink nursery • Segregated size classes • Eliminates fragmentation • Reduces memory pressure • Essentially page-oriented GenMS + compaction

  22. Segregated Size Classes • Mark objects

  23. Segregated Size Classes • Copy into empty spaces

  24. Cooperative Collection • GC and VM communication • Before-paging callback • Per-page eviction negotiation • Modify collector • Manage heap memory at page granularity • GC on page eviction notification • When possible, return empty pages • Otherwise, process pages before eviction: “bookmarking”

  25. Bookmarking RAM Hard Disk Process pages before they are evicted…

  26. Bookmarking RAM Hard Disk …by “bookmarking” target objects

  27. Bookmarking RAM Hard Disk then allow page eviction

  28. Collection with Bookmarking RAM Hard Disk process objects as normal except…

  29. Collection with Bookmarking RAM Hard Disk …ignore references to evicted pages

  30. Collection with Bookmarking RAM Hard Disk bookmarks remember references from disk

  31. Collection with Bookmarking RAM Hard Disk Result: no paging!

  32. Bookmarking Details • Cheap summary of connectivity • One bit per object: stolen from object header • One word per page: count of pages that hold bookmarks on this page • Clear bookmarks when zero • Invoke VM-oblivious collection only when heap is exhausted • Common case for all other collectors! • In practice: hasn’t happened yet

  33. Outline • Motivation • GC Paging Behavior • Hippocratic Garbage Collection • Cooperation • Bookmarking • Results • Future Work

  34. Methodology • Jikes RVM, MMTk, extended Linux kernel • “OPT + reset” • Opt-compile first, full collection,second timing run • Benchmarks: • SPECjvm98, DaCapo suite (ipsixql, jython) • SPECjbb variant (pseudojbb) • Signalmemfor memory pressure • Dynamic (30MB, then 60MB) • Static (40% of heap available)

  35. Execution time:No Memory Pressure • Generally runs in smaller heaps, fast as GenMS

  36. Execution Time:No Memory Pressure – pseudoJBB • CopyMS, etc. at least 6%-89% slower

  37. Execution Time:Dynamic Memory Pressure • Startup process: 30MB, then 60MB more

  38. Pause Time:Dynamic Memory Pressure • Startup process: 30MB, then 60MB more

  39. Execution Time:Constant Memory Pressure • Memory sufficient to hold 40% of heap

  40. Pause Times:Constant Memory Pressure • Memory sufficient to hold 40% of heap

  41. Future Work • Different eviction strategies • Exploit type info, fewer pointers • Richer summaries • Shrink heap vs. evict pages; grow heap • Requires more VM info • Static analyses • Combine with automatic heap sizing[Yang et al., ISMM 04]

  42. Conclusion • Hippocratic Garbage Collection • Cooperates with VM • Competitive when not paging • Performs up to 13% faster with small heaps • As fast as GenMS for larger heaps • Greatly improves performance when paging • Throughput up to 3x greater • Average pause times up to 30x smaller than CopyMS, 70x smaller than GenMS

  43. Backup Slides

  44. Some Related Work • Compaction: reduce working set • Linearize lists [Bobrow & Murphy] • Semispace collection [Baker, Fenichel & Yochelson] • Reduce frequency of whole-heap collection • Ephemeral[Moon] & generational collectors[Lieberman & Hewett, Ungar, Appel] • Cooperation • Shrink heap [Alonso & Appel] • Give up empty pages [Cooper, Nettles et al.]

  45. Tracking Page Value • Maintain histogram per page position • Provides value to application of n pages (for any n) protected unprotected

More Related