Canisius College Department of Computer Science Canisius College University of Rochester Poor Richard's Memory Manager Tongxin Bai, Jonathan Bard, Stephen.

Slides:



Advertisements
Similar presentations
An Implementation of Mostly- Copying GC on Ruby VM Tomoharu Ugawa The University of Electro-Communications, Japan.
Advertisements

Virtual Memory (II) CSCI 444/544 Operating Systems Fall 2008.
Paging: Design Issues. Readings r Silbershatz et al: ,
 RAID stands for Redundant Array of Independent Disks  A system of arranging multiple disks for redundancy (or performance)  Term first coined in 1987.
Intro to Computer Org. Pipelining, Part 2 – Data hazards + Stalls.
Difference Engine: Harnessing Memory Redundancy in Virtual Machines by Diwaker Gupta et al. presented by Jonathan Berkhahn.
Garbage Collecting the World Bernard Lang Christian Queinnec Jose Piquer Presented by Yu-Jin Chia See also: pp text.
8.1 Advanced Operating Systems Defeating The Thrashing The RAM is limited. Sometimes, too many processes need large memory allocations and the sum of these.
Hastings Purify: Fast Detection of Memory Leaks and Access Errors.
Online Performance Auditing Using Hot Optimizations Without Getting Burned Jeremy Lau (UCSD, IBM) Matthew Arnold (IBM) Michael Hind (IBM) Brad Calder (UCSD)
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
Disk Access Model. Using Secondary Storage Effectively In most studies of algorithms, one assumes the “RAM model”: –Data is in main memory, –Access to.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
G Robert Grimm New York University Cool Pet Tricks with… …Virtual Memory.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science CRAMM: Virtual Memory Support for Garbage-Collected Applications Ting Yang, Emery.
Concurrent Processes Lecture 5. Introduction Modern operating systems can handle more than one process at a time System scheduler manages processes and.
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
CS 333 Introduction to Operating Systems Class 18 - File System Performance Jonathan Walpole Computer Science Portland State University.
CS510 Concurrent Systems Class 2 A Lock-Free Multiprocessor OS Kernel.
U NIVERSITY OF M ASSACHUSETTS Department of Computer Science Automatic Heap Sizing Ting Yang, Matthew Hertz Emery Berger, Eliot Moss University of Massachusetts.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
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.
Using Secondary Storage Effectively In most studies of algorithms, one assumes the "RAM model“: –The data is in main memory, –Access to any item of data.
Operating Systems CS208. What is Operating System? It is a program. It is the first piece of software to run after the system boots. It coordinates the.
1 Reducing Generational Copy Reserve Overhead with Fallback Compaction Phil McGachey and Antony L. Hosking June 2006.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS Michael M. Swift Brian N. Bershad Henry M. Levy University of Washington.
Exploring Multi-Threaded Java Application Performance on Multicore Hardware Ghent University, Belgium OOPSLA 2012 presentation – October 24 th 2012 Jennifer.
Fast Conservative Garbage Collection Rifat Shahriyar Stephen M. Blackburn Australian National University Kathryn S. M cKinley Microsoft Research.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 Automatic Heap Sizing: Taking Real Memory into Account Ting Yang, Emery Berger,
XP Practical PC, 3e Chapter 6 1 Protecting Your Files.
Investigating the Effects of Using Different Nursery Sizing Policies on Performance Tony Guan, Witty Srisa-an, and Neo Jia Department of Computer Science.
1 Some Real Problem  What if a program needs more memory than the machine has? —even if individual programs fit in memory, how can we run multiple programs?
CY2003 Computer Systems Lecture 04 Interprocess Communication.
CS 3204 Operating Systems Godmar Back Lecture 21.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
CS333 Intro to Operating Systems Jonathan Walpole.
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
® July 21, 2004GC Summer School1 Cycles to Recycle: Copy GC Without Stopping the World The Sapphire Collector Richard L. Hudson J. Eliot B. Moss Originally.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
Lecture 10 Page 1 CS 111 Online Memory Management CS 111 On-Line MS Program Operating Systems Peter Reiher.
Information Systems Design and Development Technical Implications (Software) Computing Science.
Representation of Data - Instructions Start of the lesson: Open this PowerPoint from the A451 page – Representation of Data/ Instructions How confident.
Ch. 4 Memory Mangement Parkinson’s law: “Programs expand to fill the memory available to hold them.”
Speculative execution Landon Cox April 13, Making disk accesses tolerable Basic idea Remove disk accesses from critical path Transform disk latencies.
Memory Management.
Free Transactions with Rio Vista
Jonathan Walpole Computer Science Portland State University
Segmentation COMP 755.
CSC 322 Operating Systems Concepts Lecture - 12: by
Chapter 9: Virtual Memory – Part I
Page Replacement.
Intro. To Operating Systems
Free Transactions with Rio Vista
CSE 451: Operating Systems Autumn 2005 Memory Management
CSE451 Virtual Memory Paging Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Multithreading Why & How.
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Lecture 9: Caching and Demand-Paged Virtual Memory
Program-level Adaptive Memory Management
Presentation transcript:

Canisius College Department of Computer Science Canisius College University of Rochester Poor Richard's Memory Manager Tongxin Bai, Jonathan Bard, Stephen Kane, Elizabeth Keudel, Matthew Hertz, & Chen Ding Canisius College

Canisius College University of Rochester GC Performance Good news: GC performance is competitive Matches average performance of good allocator 10% faster Ran some benchmarks up to 10% faster Bad news: GC is serious memory hog Footprint 5x larger for quickest runs All runs had at least double the footprint GC’s paging performance is bad GC’s paging performance is bad

Canisius College University of Rochester GC Performance Good news: GC performance is competitive Matches average performance of good allocator 10% faster Ran some benchmarks up to 10% faster Bad news: GC is serious memory hog Footprint 5x larger for quickest runs All runs had at least double the footprint GC’s paging performance is bad horrible GC’s paging performance is bad horrible

Canisius College University of Rochester GC Performance Good news: GC performance is competitive Matches average performance of good allocator 10% faster Ran some benchmarks up to 10% faster Bad news: GC is serious memory hog Footprint 5x larger for quickest runs All runs had at least double the footprint GC’s paging performance is bad horrible GC’s paging performance is bad horrible

Canisius College University of Rochester Ways To Make A Computer Cry

Canisius College University of Rochester What Can We Do? Select a good heap size to "solve" problem Large enough to use all available memory… …but not trigger paging by being too large May be able to find on dedicated machine If stuck working in 1999, this is excellent news What about multiprocessor, multicore machines? Available memory fluctuates with each application

Canisius College University of Rochester What Can We Do?

Canisius College University of Rochester What Can We Do? or

Canisius College University of Rochester Our First Inspiration Little strokes fell great oaks

Canisius College University of Rochester Our Idea Maintain performance of existing collectors Assume that paging is not common case Keep changes small & outside of current systems sFocus on the correct problem: page faults No serious slowdown from small number of faults Instead need to prevent faults from snowballing

Canisius College University of Rochester Our Approach Process will check fault count periodically Tolerate a few new faults at each check, but… …must act when faults are too high Prevent slowdown caused by many faults Force garbage collection once enough faults seen GC reduces pages needed & keeps them in RAM Pressure now dealt with; so heap can regrow

Canisius College University of Rochester Memory is System-Wide Share information using whiteboard

Canisius College University of Rochester Memory is System-Wide Share information using whiteboard Alert all processes when increased faults detected Check for alert during periodic fault count check Even if no fault locally, collect heap when alerted Whiteboard prevents run on memory, also Collection temporarily increases memory needs Paging is worsened by all processes GC at once Processes use whiteboard to serialize collections

Canisius College University of Rochester Experimental Methodology Java platform: MMTk/Jikes RVM (revision 15128) PseudoAdaptive compiler & GenMS collector Hardware: Dual 2.8 GHz Xeon w/ hyperthreading turned on Booted with option "mem=256M" limiting memory Operating System: Ubuntu 9.04 (Linux kernel )

Canisius College University of Rochester Experimental Methodology Benchmarks used: pseudoJBB – fixed workload variant of SPECjbb bloat, fop, pmd, xalan – from DaCapo suite DaCapo benchmarks looped multiple times Initial (compilation) run included in results When not paging, runs total about 1:17 Ran 2 benchmarks simultaneously Record time until both processes completed

Canisius College University of Rochester Little Strokes Fell Great Oaks Time Needed to Complete pseudoJBB Runs

Canisius College University of Rochester Little Strokes Fell Great Oaks Time Needed to Complete Bloat-Fop Runs

Canisius College University of Rochester Our Second Inspiration Early bird catches the worm

Canisius College University of Rochester Problem With Faults Page faults help keep heap in available RAM Faults detectable only after heap grew too big Usually good enough to avoid major slowdowns And may cause problems if evicted pages unused Better knowing before pages faulted back in Could shrink heap earlier and avoid page faults Changes to OS, JVM, GC to send & receive alerts Ideally would have a more lightweight solution

Canisius College University of Rochester RSS Is Not Just For Blogs Resident set size available with fault count Records number of pages currently in memory RSS goes up when pages touched or faulted in If pages unmapped or evicted, RSS goes down RSS provides early warning in steady state Will eventually see pages faults after RSS drops Assumes pages not released as app executes (Safe assumption that holds in most systems)

Canisius College University of Rochester Early Bird Catches The Worm Time Needed to Complete pseudoJBB Runs

Canisius College University of Rochester Early Bird Catches The Worm Average Result Across All Our Experiments

Canisius College University of Rochester RSS Is Not A Panacea Average Result Across All Our Experiments

Canisius College University of Rochester Our Third Inspiration The Lord helps those who help themselves

Canisius College University of Rochester "Greed Is Good" Previously results showed cooperative work Individually track page faults & RSS for alerts Changes share and reacted to on collective basis System-wide resource so this would make sense But there are some costs to cooperation Mutexes used to protect critical sections Sharing enabled by allocating more memory Extra collections triggered & may not be needed

Canisius College University of Rochester Process Help Thyself Selfish approach similar to previous system Continues to periodically check page faults & RSS Trigger collection on too many faults or RSS drop Other applications will not be sent update Simultaneous collections will not be prevented Initially rejected as appears this is a bad idea But done well by Ben Franklin so far…

Canisius College University of Rochester Those Who Help Themselves Average Result Across All Our Experiments

Canisius College University of Rochester Our Last Inspiration Only 2 certainties in life, death & taxes

Canisius College University of Rochester Our Last Inspiration (Almost) Only 2 certainties in life, death & taxes 3 & Poor Richard

Canisius College University of Rochester Advice Good In Many Situations Inspiration very general & so was code Approach was independent of GC algorithm Few changes needed to Jikes RVM (< 30 LOC) Majority of code written in standalone file Could other collectors benefit from this? Others tend to be less resilient to paging Uses more pages with quicker growth to RSS (At least in Jikes, usually perform much worse)

Canisius College University of Rochester Let's Hear It For Poor Richard! Time Needed to Complete Bloat-Fop Runs

Canisius College University of Rochester Does This Really Hold? Also tested in Mono Virtual Machine Open-source system for running.Net programs BDW collector for whole-heap, non-moving GC Written for C, BDW cannot shrink heap Fewer than 10 LOC modified during port Bulk of PRMM code copied without modification

Canisius College University of Rochester Let's Hear It For Poor Richard!

Canisius College University of Rochester Conclusion Poor Richard's advice continues to hold PRMM solves GC's paging problem Few changes needed to add to existing systems When not paging, good performance is maintained Averages 2x speedup for best collector Improves nearly every algorithm and system

Canisius College University of Rochester The Team