U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 Automatic Heap Sizing: Taking Real Memory into Account Ting Yang, Emery Berger,

Slides:



Advertisements
Similar presentations
Chapter 11 – Virtual Memory Management
Advertisements

Chapter 11 – Virtual Memory Management
Paging: Design Issues. Readings r Silbershatz et al: ,
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Matthew Hertz, Yi Feng, & Emery Berger Department of Computer Science University.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.
Chapter 3 Process Description and Control
Steve Blackburn Department of Computer Science Australian National University Perry Cheng TJ Watson Research Center IBM Research Kathryn McKinley Department.
1 Write Barrier Elision for Concurrent Garbage Collectors Martin T. Vechev Cambridge University David F. Bacon IBM T.J.Watson Research Center.
Canisius College Department of Computer Science Canisius College University of Rochester Poor Richard's Memory Manager Tongxin Bai, Jonathan Bard, Stephen.
Allocation of Frames Each process needs minimum number of pages
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.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science CRAMM: Virtual Memory Support for Garbage-Collected Applications Ting Yang, Emery.
Operating Systems CMPSCI 377 Lecture 11: Memory Management
21 September 2005Rotor Capstone Workshop Parallel, Real-Time Garbage Collection Daniel Spoonhower Guy Blelloch, Robert Harper, David Swasey Carnegie Mellon.
Improving Proxy Cache Performance: Analysis of Three Replacement Policies Dilley, J.; Arlitt, M. A journal paper of IEEE Internet Computing, Volume: 3.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
U NIVERSITY OF M ASSACHUSETTS Department of Computer Science Automatic Heap Sizing Ting Yang, Matthew Hertz Emery Berger, Eliot Moss University of Massachusetts.
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
U NIVERSITY OF M ASSACHUSETTS, A MHERST – Department of Computer Science Dynamic Resource Allocation for Shared Data Centers Using Online Measurements.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Garbage Collection Without Paging Matthew Hertz, Yi Feng, Emery Berger University.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Quantifying the Performance of Garbage Collection vs. Explicit Memory Management.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
1 Reducing Generational Copy Reserve Overhead with Fallback Compaction Phil McGachey and Antony L. Hosking June 2006.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science John Cavazos Architecture and Language Implementation Lab Thesis Seminar University.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 2006 Exterminator: Automatically Correcting Memory Errors Gene Novark, Emery Berger.
Maninder Kaur VIRTUAL MEMORY 24-Nov
An Adaptive, Region-based Allocator for Java Feng Qian, Laurie Hendren {fqian, Sable Research Group School of Computer Science McGill.
Processes and OS basics. RHS – SOC 2 OS Basics An Operating System (OS) is essentially an abstraction of a computer As a user or programmer, I do not.
1 Wenguang WangRichard B. Bunt Department of Computer Science University of Saskatchewan November 14, 2000 Simulating DB2 Buffer Pool Management.
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Advanced Compilers CMPSCI 710 Spring 2004 Lecture 1 Emery Berger University of Massachusetts,
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Emery Berger and Mark Corner University of Massachusetts Amherst Computer Systems.
U NIVERSITY OF M ASSACHUSETTS, A MHERST – Department of Computer Science Performance of Work Stealing in Multiprogrammed Environments Matthew Hertz Department.
September 11, 2003 Beltway: Getting Around GC Gridlock Steve Blackburn, Kathryn McKinley Richard Jones, Eliot Moss Modified by: Weiming Zhao Oct
Investigating the Effects of Using Different Nursery Sizing Policies on Performance Tony Guan, Witty Srisa-an, and Neo Jia Department of Computer Science.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Yi Feng & Emery Berger University of Massachusetts Amherst A Locality-Improving.
380C lecture 19 Where are we & where we are going –Managed languages Dynamic compilation Inlining Garbage collection –Opportunity to improve data locality.
1 Garbage Collection Advantage: Improving Program Locality Xianglong Huang (UT) Stephen M Blackburn (ANU), Kathryn S McKinley (UT) J Eliot B Moss (UMass),
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
David F. Bacon Perry Cheng V.T. Rajan IBM T.J. Watson Research Center ControllingFragmentation and Space Consumption in the Metronome.
Project Presentation By: Dean Morrison 12/6/2006 Dynamically Adaptive Prepaging for Effective Virtual Memory Management.
A REAL-TIME GARBAGE COLLECTOR WITH LOW OVERHEAD AND CONSISTENT UTILIZATION David F. Bacon, Perry Cheng, and V.T. Rajan IBM T.J. Watson Research Center.
1 GC Advantage: Improving Program Locality Xianglong Huang, Zhenlin Wang, Stephen M Blackburn, Kathryn S McKinley, J Eliot B Moss, Perry Cheng.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science John Cavazos J Eliot B Moss Architecture and Language Implementation Lab University.
1 Page Replacement Algorithms. 2 Virtual Memory Management Fundamental issues : A Recap Key concept: Demand paging  Load pages into memory only when.
Lecture 10 Page 1 CS 111 Online Memory Management CS 111 On-Line MS Program Operating Systems Peter Reiher.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Page Replacement FIFO, LIFO, LRU, NUR, Second chance
1 The Garbage Collection Advantage: Improving Program Locality Xianglong Huang (UT), Stephen M Blackburn (ANU), Kathryn S McKinley (UT) J Eliot B Moss.
Java 9: The Quest for Very Large Heaps
Chapter 9 – Real Memory Organization and Management
Department of Computer Science University of California, Santa Barbara
David F. Bacon, Perry Cheng, and V.T. Rajan
Adaptive Code Unloading for Resource-Constrained JVMs
Transparent Contribution of Memory
Page Replacement FIFO, LIFO, LRU, NUR, Second chance
Virtual Memory: Working Sets
Department of Computer Science University of California, Santa Barbara
Garbage Collection Advantage: Improving Program Locality
Operating Systems Concepts
COMP755 Advanced Operating Systems
Program-level Adaptive Memory Management
Transparent Contribution of Memory
Presentation transcript:

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 Automatic Heap Sizing: Taking Real Memory into Account Ting Yang, Emery Berger, Matthew Hertz, Scott Kaplan ¶, Eliot Moss Department of Computer Science Department of Computer Science ¶ University of Massachusetts Amherst College Amherst MA Amherst MA

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 2 Appel _213_javac 60MB real memory Too small: GC a lot Too large: page a lot Optimal Problem & Motivation Heap size vs Running time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 3 Problem & Motivation Multiprogramming makes it harder: Amount of available real memory changes Impossible to select heap size a priori Strategy: adjust adaptively during execution

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 4 Outline Problem & Motivation Problem & Motivation Paging behavior of Garbage Collection Paging behavior of Garbage Collection VMM: collecting the information we need VMM: collecting the information we need Collector: adjusting heap size adaptively Collector: adjusting heap size adaptively Experimental results Experimental results Conclusion & Future work Conclusion & Future work

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 5 GC Paging Behavior For strategy to work, need to relate: GC algorithm, heap size, and footprint Analysis methodology: Obtain reference trace: simulate Jikes RVM under DSS Process with LRU stack  # faults at all memory sizes GCs and programs traced: Mark-Sweep (MS), Semi-Space (SS), and Appel GCs SPECjvm98, ipsixql, and pseudojbb benchmarks

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 6 Heap Size = 240Mb Memory = 145Mb # of Faults ≈ seconds extreme paging substantial paging: “looping” behavior fits into memory Fault curve: Relationship of heap size, real memory & page faults Heap size= 0.5 second

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 7 Relationship between heap size and footprint Page fault threshold = Our definition of footprint: The amount of memory needed so that the time spent on page faults is lower than a certain percentage of total execution time

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 8 A Linear Model: Heap size vs. Footprint Heap footprint model : Heaputil : SS 0.5; MS: 1 base : Jikes RVM plus live data size How the GC can use this model:

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 9 Strategy Overview VMM ( in OS) Knows memory allocation / available memory Needs to track/calculate application footprint Garbage Collector (in User Space) Has ability to change heap size Needs info: available memory, footprint Request: mem alloc footprint Send: mem alloc footprint

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 10 Outline Problem & Motivation Problem & Motivation Paging behavior of Garbage Collection Paging behavior of Garbage Collection VMM: collecting the information we need VMM: collecting the information we need Collector: adjusting heap size adaptively Collector: adjusting heap size adaptively Experimental results Experimental results Conclusion & Future work Conclusion & Future work

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 11 defghijklmncklmncbcdefghijklmncklmnabaabcdefghijklmnabcdefghijklmnabdefghijcklnmabcdefghijkmnlabcdefghijlmnkabdefghijklmnc4n3211 Approach to Measuring Footprint Memory reference sequence LRU Queue Pages in Least Recently Used order Hit Histogram Fault Curve mn 114 lmnklmncklmnabcdefghijklmncklmn pages5 pages Associated with each LRU position

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 12 VMM design: SegQ [SKW’99,KMC’02] LRU Queue Hit Histogram Hot setCold set Evicted set Hot / Cold Boundary CLOCK algorithm Strict LRU Decay histogram periodically Adaptive control of hot set size Footprint Major fault (on disk)Minor fault (in memory)

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 13 VMM design: SegQ [SKW’99,KMC’02] Hot setCold set Evicted set Hot / Cold Boundary CLOCK algorithm Strict LRU Footprint What is the footprint w.r.t 5%?

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 14 Outline Problem & Motivation Problem & Motivation Paging behavior of Garbage Collection Paging behavior of Garbage Collection VMM: collecting the information we need VMM: collecting the information we need Collector: adjusting heap size adaptively Collector: adjusting heap size adaptively Experimental results Experimental results Conclusion & Future work Conclusion & Future work

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 15 Collector Design: Communicate with VMM after GC First GC: Appel, SS: HeapUtil = 0.5 Following GCs: Calculate HeapUtil from history

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 16 Outline Problem & Motivation Problem & Motivation Paging behavior of Garbage Collection Paging behavior of Garbage Collection VMM: collecting the information we need VMM: collecting the information we need Collector: adjusting heap size adaptively Collector: adjusting heap size adaptively Experimental results Experimental results Conclusion & Future work Conclusion & Future work

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 17 Experiments Experimental setting: Jikes RVM Dynamic SimpleScalar: extended with new VMM model Major fault = 5 million instructions = 5 1 Gips Minor fault = 2000 instructions = 2 µs Page fault cost threshold = 5% - 10% Histogram collecting cost threshold = 1% Adapting to fixed memory pressure Adapting to dynamic memory pressure Add/Remove 15MB real memory after 2 billion insts

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 18 Memory under-utilized Optimal heap Paging a lot Larger heap Fewer GCs Less Paging 60MB Real Memory Appel _213_javac

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 19 60MB Real Memory Appel _213_javac Increase memory: 15MB at 2 billion instructions

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 20 60MB Real Memory Appel _213_javac Decrease memory: 15MB at 2 billion instructions

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 21 Conclusion: Automatic Heap Sizing New collector usually picks heap size that: Maximizes memory utilization (reducing GCs) While avoiding paging Linear model works well in practice Improves performance by up to 8x under pressure Cost of collecting information is low: around 1% New collector adapts quickly to steady and to changing real memory allocations Within 1 or 2 major GCs

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 22 Ongoing Work Implement in real kernel Extend to more collectors Adjust during allocation, not just after GC Detailed graphs & tech report: