- 快召唤伙伴们来围观吧
- 微博 QQ QQ空间 贴吧
- 文档嵌入链接
- 复制
- 微信扫一扫分享
- 已成功复制到剪贴板
ZGC-Jfokus-2018
展开查看详情
1 .The Z Garbage Collector Low Latency GC for OpenJDK Per Lidén & Stefan Karlsson HotSpot Garbage Collection Team Jfokus VM Tech Summit 2018 Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
2 .Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 2
3 .Agenda 1 What is ZGC? 2 Some Numbers 3 Under The Hood 4 Going Forward 5 How To Get Started Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 3
4 .Agenda 1 What is ZGC? 2 Some Numbers 3 Under The Hood 4 Going Forward 5 How To Get Started Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 4
5 .A Scalable Low Latency Garbage Collector Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 5
6 .Goals TB Multi-terabyte heaps 10ms Max GC pause time Lay the foundation for future GC features 15% Max application throughput reduction Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 6
7 .GC pause times do not increase with heap or live-set size Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 7
8 .At a Glance • New garbage collector • Concurrent • Load barriers ✔ Marking ✔ Relocation/Compaction • Colored pointers ✔ Relocation Set Selection • Single generation ✔ Reference Processing • Partial compaction ✔ JNI WeakRefs Cleaning • Region-based - StringTable/SymbolTable Cleaning - Class Unloading • Immediate memory reuse • NUMA-aware Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 8
9 .Current Status • Design and implementation approaching mature and stable • Main focus on Linux/x86_64 – Other platforms can be added if there’s enough demand • Performance looks very good – Both in terms of latency and throughput Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 9
10 .Agenda 1 What is ZGC? 2 Some Numbers 3 Under The Hood 4 Going Forward 5 How To Get Started Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 10
11 .SPECjbb®2015 – Score (Higher is better) Mode: Composite 100% 90% Heap Size: 128G 80% OS: Oracle Linux 7.4 70% HW: Intel Xeon E5-2690 2.9GHz 60% 2 sockets, 16 cores (32 hw-threads) 50% 40% 30% 20% 10% 0% ZGC Parallel G1 SPECjbb®2015 is a registered trademark of the Standard Performance max-JOPS (Throughput) critical-JOPS (Throughput with latency requirements) Evaluation Corporation (spec.org). The actual results are not represented as compliant because the SUT may not meet SPEC's requirements for general availability. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 11
12 .SPECjbb®2015 – Pause Times Linear scale (Lower is better) Logarithmic scale 900 1000 800 Same data, different scales 700 GC Pause Times (ms) GC Pause Times (ms) 600 100 500 400 300 10 200 100 0 1 ZGC Parallel G1 ZGC Parallel G1 Average 95th percentile 99th percentile 99.9th percentile Max Average 95th percentile 99th percentile 99.9th percentile Max Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 12
13 .Agenda 1 What is ZGC? 2 Some Numbers 3 Under The Hood 4 Going Forward 5 How To Get Started Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 13
14 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate GC Cycle Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 14
15 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate Mark objects GC Cycle pointed to by roots Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 15
16 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate Walk the object graph GC Cycle and mark objects Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 16
17 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate GC Cycle Synchronization point (Weak roots cleaning) Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 17
18 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate GC Cycle Reference processing Weak root cleaning Relocation set selection Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 18
19 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate GC Cycle Handle roots pointing into the relocation set Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 19
20 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate GC Cycle Relocate objects in the relocation set Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 20
21 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Mark/Remap Prepare for Reloc. Relocate GC Cycle Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 21
22 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Concurrent Mark Prepare for Reloc. Relocate Remap GC Cycle Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 22
23 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Concurrent Mark Prepare for Reloc. Relocate Remap Walks object graph GC Cycle Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 23
24 .ZGC Phases Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Concurrent Concurrent Concurrent Mark Prepare for Reloc. Relocate Remap Walks object graph GC Cycle Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 24
25 .ZGC Phases Mark Start Mark End Relocate Start Mark Start Mark End Relocate Start Mark Start Mark End Relocate Start Concurrent Mark Prepare for Reloc Concurrent Reloc Concurrent Remap Prepare for Reloc Concurrent Reloc Concurrent Remap Prepare for Reloc Concurrent Reloc Concurrent Remap Concurrent Mark Concurrent Mark GC Cycle 1 GC Cycle 2 GC Cycle 3 Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 25
26 .Heap Address Space Max heap size Heap Memory/Regions Maps into Heap Address Space Large address space reservation Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 26
27 .Heap Regions Also known as ZPages • Dynamically created/destroyed • Dynamically sized – Multiple of 2MB on x86_64 • Size groups – Small (2MB) – Medium (32MB) – Large (N x 2MB) Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 27
28 .Colored Pointers • Core design concept in ZGC • Metadata stored in unused bits in 64-bit pointers – No support for 32-bit platforms – No support for CompressedOops • Virtual Address-masking either in hardware, OS or software – Heap multi-mapping on Linux/x86_64 – Supported in hardware on Solaris/SPARC Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 28
29 .Colored Pointers Layout on x86_64 Remapped Marked1 Finalizable Marked0 Unused (18 bits) Object Address (42 bits, 4TB address space) 64-bit Object Pointer Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 29