g1: to infinity and beyond -...

21
Copyright © 2020 Oracle and/or its affiliates. FOSDEM 2020 G1: To Infinity and Beyond Principal Member of Technical Staff HotSpot GC-team, Oracle Twitter: @kstefanj Stefan Johansson

Upload: others

Post on 04-Jun-2020

3 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

Copyright © 2020 Oracle and/or its affiliates.

FOSDEM 2020G1: To Infinity and Beyond

Principal Member of Technical Staff

HotSpot GC-team, OracleTwitter: @kstefanj

Stefan Johansson

Page 2: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

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, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation.

Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events.

Safe Harbor

Copyright © 2020 Oracle and/or its affiliates.

Page 3: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• GC in OpenJDK

• Short intro to G1

• Progress since JDK 8

• The future

Copyright © 2020 Oracle and/or its affiliates.

Agenda

3

Page 4: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

Copyright © 2020 Oracle and/or its affiliates.

GC in OpenJDK

4

Page 5: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Fast allocation

• Efficient reclamation

• Concepts and tradeoffs

• Throughput

• Latency

• Footprint

Copyright © 2020 Oracle and/or its affiliates.

IntroductionGC in OpenJDK

5

Page 6: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

Copyright © 2020 Oracle and/or its affiliates.

Current CollectorsGC in OpenJDK

Collector name Status Comment

Serial Supported Low memory footprint

Parallel Supported Throughput oriented

G1 Supported/Default Balanced performance

ZGC Experimental Low latency

Shenandoah Experimental Low latency

CMS Removed in JDK 14 Unmaintained

6

Page 7: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

Copyright © 2020 Oracle and/or its affiliates.

Short intro to G1

7

Page 8: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Balance between throughput and latency

• Region based

• Concurrent marking

• Main tuning knob: pause-time goal

Copyright © 2020 Oracle and/or its affiliates.

Basic ideaShort intro to G1

8

Page 9: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Supported since JDK 7u4

• Default since JDK 9

• Stable and mature

• Continuously being improved

Copyright © 2020 Oracle and/or its affiliates.

Current statusShort intro to G1

9

Page 10: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

Copyright © 2020 Oracle and/or its affiliates.

Progress since JDK 8

10

Page 11: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• 700 enhancements since JDK 8

• Significant improvements

• Across all areas

• Cut away old tradeoffs

Copyright © 2020 Oracle and/or its affiliates.

OverviewProgress since JDK 8

11

Page 12: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Improved NUMA awareness

• More efficient concurrent work

• Parallel Full collection

Copyright © 2020 Oracle and/or its affiliates.

ThroughputProgress since JDK 8

12

Page 13: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• SPECjbb® 2015 results

• 16GB heap

• Not only GC improvements

• More time spent running Java

Copyright © 2020 Oracle and/or its affiliates.

Throughput Progress since JDK 8

0%

20%

40%

60%

80%

100%

120%

JDK 8

Parallel

JDK 8

G1

JDK 11

G1

JDK 14

G1

SPEC® and the benchmark name SPECjbb® are registered trademarks of the Standard Performance Evaluation Corporation. For more information about SPECjbb, see www.spec.org/jbb2015/.

Throughput improvements

13

Page 14: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Improved parallelism

• More efficient reference processing

• Better pause time predictions

• Abortable mixed collections

Copyright © 2020 Oracle and/or its affiliates.

Latency Progress since JDK 8

14

Page 15: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• SPECjbb® 2015 results

• 16GB heap

• Mostly GC improvements

• Trade throughput for latency

Copyright © 2020 Oracle and/or its affiliates.

LatencyProgress since JDK 8

0%

20%

40%

60%

80%

100%

120%

140%

160%

JDK 8

Parallel

JDK 8

G1

JDK 11

G1

JDK 14

G1

JDK 14

G1@50ms

SPEC® and the benchmark name SPECjbb® are registered trademarks of the Standard Performance Evaluation Corporation. For more information about SPECjbb, see www.spec.org/jbb2015/.

Latency improvements

15

Page 16: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Rebuild remembered sets concurrently

• Improved sizing ergonomics

• Return memory to the operating system

Copyright © 2020 Oracle and/or its affiliates.

Footprint Progress since JDK 8

16

Page 17: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• BigRamTester

• 16GB heap

Footprint Progress since JDK 8

0

1

2

3

4

5

JDK 8 JDK 11 JDK 14

Native memory usage over time (GB)

Copyright © 2020 Oracle and/or its affiliates. 17

Page 18: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

Copyright © 2020 Oracle and/or its affiliates.

The Future

18

Page 19: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Humongous object handling

• Improved write barrier

• Footprint reductions

Copyright © 2020 Oracle and/or its affiliates.

InvestigationsThe Future

19

Page 20: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

• Massive improvements since JDK 8

• Exciting features in the pipe

Copyright © 2020 Oracle and/or its affiliates.

Key take aways

20

To Infinity and Beyond

Page 21: G1: To Infinity and Beyond - cr.openjdk.java.netcr.openjdk.java.net/~sjohanss/slides/fosdem_2020_-_g1.pdf · Statements in this presentation relating to Oracle’s future plans, expectations,

Copyright © 2020 Oracle and/or its affiliates.

Questions

21

Stefan JohanssonTwitter: @kstefanj