Presentation is loading. Please wait.

Presentation is loading. Please wait.

MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan.

Similar presentations


Presentation on theme: "MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan."— Presentation transcript:

1 MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan

2 Motivation Handheld Devices Cellular phones, PDAs widely used Constrained memory Diverse applications Media players Video games Digital cameras GPS Scaled down desktop apps (e-mail, browser etc.) Require high throughput, short response time, better memory utilization

3 Talk Outline Generational collection and MC overview MC 2 overview Algorithmic Details Experimental Results Conclusions

4 Generational Collection Divide heap into regions called generations Generations segregate objects by age Focus GC effort on younger objects Nursery Old Generation

5 Generational Copying Collection Old Generation A B C Root D ED E Nursery Remset

6 Generational Copying Collection A B C Root D E A D B E Old Generation Nursery

7 MC Overview Extends gen. copying Divides space into equal size windows Reserves one or more windows for copying Collects in two phases: mark and copy Generational copying MC Nursery Old Generation

8 MC – Mark Phase

9

10 MC-Copy Phase

11 MC 2 – Mark Phase Logically order old gen. windows Three mark phase tasks: Mark reachable objects Calculate live data volume in each window Build per-window remembered sets Start when old gen. getting full: 80%, say Interleave marking with nursery allocation Do some marking after every n(32KB) bytes allocated Reduces mark phase pauses

12 MC 2 Example – Mark Phase MC 2 marks two objects during nursery allocation Old Generation Nursery L1L1 L2L2 L3L3 L4L4 Root L max Root Nursery Unreachable Reachable Marked Copied

13 MC 2 Example – Classify Windows Old Generation Nursery L1L1 L2L2 L3L3 L4L4 Root L max Root Locate high-occupancy windows and discard remsets Nursery Unreachable Reachable Marked Copied

14 MC 2 Example – Classify Windows Old Generation Nursery L1L1 L2L2 L3L3 L4L4 Root L max Root Locate high-occupancy windows and discard remsets Nursery Unreachable Reachable Marked Copied

15 MC 2 Example – Classify Windows Old Generation Nursery L2L2 L3L3 L4L4 Root L max Root L max Locate high-occupancy windows and discard remsets Nursery Unreachable Reachable Marked Copied

16 Incremental Marking Error

17 Handling marking error Track mutations using write barrier Record modified old generation objects Scan these modified objects at GC time Record interesting slots in remembered sets Snapshot at the beginning Incremental Update

18 MC 2 – Copy Phase Copy and compact reachable data Performed in small increments One windowful of live data copied per increment One increment per nursery collection High-occupancy windows copied logically

19 MC 2 Example – Copy Phase Old Generation Nursery L max L2L2 L3L3 L4L4 Root L max Root Copy a window worth of data during nursery collection Nursery Unreachable Reachable Marked Copied

20 MC 2 Example – Copy Phase Old Generation Nursery L max L2L2 L3L3 L4L4 Root L max Root Nursery Unreachable Reachable Marked Copied Copy a window worth of data during nursery collection

21 MC 2 Example – Copy Phase Old Generation Nursery L2L2 L3L3 L4L4 Root L max Root Nursery Unreachable Reachable Marked Copied Copy a window worth of data during nursery collection

22 MC 2 Example – Copy Phase Old Generation Nursery L2L2 L3L3 L4L4 Root L max Root Nursery Unreachable Reachable Marked Copied Copy a window worth of data during nursery collection

23 MC 2 Example – Copy Phase Old Generation Nursery L max Root L max Root Nursery Unreachable Reachable Marked Copied Copy a window worth of data during nursery collection

24 Algorithmic Details Large remembered sets Bounding space overhead Popular objects Preventing long pauses

25 Handling large remembered sets Normal remembered set for W1 stores 5 pointers (20 bytes on a 32 bit machine) W1W2

26 Handling large remembered sets W1W2 Card 1 Card 2 Card table requires only 2 bytes (one per card)

27 Handling large remembered sets Set a limit on the total remembered set size (e.g., 5% of total heap space). Replace large remembered sets with card table when total size approaches limit Good trade off between speed and space utilization

28 Handling popular objects Divide heap into small physical windows Normally copy a group of physical windows Popular physical windows not grouped Normal Windows Popular Window Normal Windows

29 Handling popular objects Divide heap into small physical windows Normally copy a group of physical windows Popular physical windows not grouped Normal Window Group Popular Window Normal Window Group

30 Handling popular objects Identify popular object while converting remembered set to card table Isolate popular object at high end of heap Do not need to maintain references to the objects Copying a popular object can cause a long pause, but does not recur

31 Experimental Results Implemented in Jikes RVM (2.2.3)/MMTk Pentium 4 1.7 GHz, 512MB memory, RedHat Linux 2.4.7-10 Benchmarks: SPECjvm98, pseudojbb Collectors evaluated Generational Mark-Sweep (MS) Generational Mark-(Sweep)-Compact (MSC) MC 2 MSC, MC 2 use separate code and data spaces Results: Execution time, pause time in a heap 1.8x program live size

32 Execution Time relative to MC 2 (Heap Size = 1.8x max. live size)

33 Max. Pause Time relative to MC 2 (Heap Size = 1.8x max. live size) MC 2 max. pause range: 17-41ms

34 Bounded Mutator Utilization (jess)

35 Bounded Mutator Utilization (javac)

36 Conclusions MC 2 : suitable for handheld devices with soft real time requirements Low space overhead (50-80%) Good throughput (3-4% slower than non- incremental compacting collector) Short pause times (17-41ms, factor of 6 lower than non-incremental compacting collector) Well distributed pauses Discussion...

37 References Narendran Sachindran, J. Eliot, B. Moss, Mark-copy: fast copying GC with less space overhead, Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, October 26-30, 2003, Anaheim, California, USA Henry Lieberman, Carl Hewitt, A real-time garbage collector based on the lifetimes of objects, Communications of the ACM, v.26 n.6, p.419-429, June 1983 H. Schorr, W. M. Waite, An efficient machine-independent procedure for garbage collection in various list structures, Communications of the ACM, v.10 n.8, p.501- 506, Aug. 1967


Download ppt "MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan."

Similar presentations


Ads by Google