jdk9 features (summary, 31/jul/2015) #jjug

61
JDK9 KUBOTA Yuji (@sugarlife) Java Japan User Group LT with b33r 10/Aug/2015

Upload: yuji-kubota

Post on 19-Aug-2015

1.694 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: JDK9 Features (Summary, 31/Jul/2015) #JJUG

JDK9KUBOTA Yuji (@sugarlife)

Java Japan User Group LT with b33r

10/Aug/2015

Page 2: JDK9 Features (Summary, 31/Jul/2015) #JJUG

Attention•Depends on OpenJDK project.

•This slide provides only the summary for LT. Something may have been changed until General Availability is released.

•Drunken Speaker, Drunken LT. Please, don’t be serious :p

http://openjdk.java.net/projects/jdk9/ (31/Jul/2015)

Page 3: JDK9 Features (Summary, 31/Jul/2015) #JJUG

Who am I

•KUBOTA Yuji (@sugarlife)•icedtea committer (HeapStats)

•OpenJDK Contributor

•JavaOne Speaker

•Hard-hearing person

Page 4: JDK9 Features (Summary, 31/Jul/2015) #JJUG

JDK9 Schedule

•2015/12/10: Feature Complete

• : Many tests

•2016/07/21: Final Release Candidate

•2016/09/22: General Availability

http://openjdk.java.net/projects/jdk9/

Page 5: JDK9 Features (Summary, 31/Jul/2015) #JJUG

What features will come?102: Process API Updates110: HTTP 2 Client143: Improve Contended Locking158: Unified JVM Logging165: Compiler Control193: Variable Handles197: Segmented Code Cache199: Smart Java Compilation, Phase Two201: Modular Source Code211: Elide Deprecation Warnings on Import Statements212: Resolve Lint and Doclint Warnings213: Milling Project Coin214: Remove GC Combinations Deprecated in JDK 8215: Tiered Attribution for javac216: Process Import Statements Correctly217: Annotations Pipeline 2.0219: Datagram Transport Layer Security (DTLS)220: Modular Run-Time Images221: Simplified Doclet API222: jshell: The Java Shell (Read-Eval-Print Loop)223: New Version-String Scheme224: HTML5 Javadoc226: UTF-8 Property Files227: Unicode 7.0228: Add More Diagnostic Commands229: Create PKCS12 Keystores by Default230: Microbenchmark Suite231: Remove Launch-Time JRE Version Selection232: Improve Secure Application Performance233: Generate Run-Time Compiler Tests Automatically235: Test Class-File Attributes Generated by javac236: Parser API for Nashorn237: Linux/AArch64 Port240: Remove the JVM TI hprof Agent241: Remove the jhat Tool243: Java-Level JVM Compiler Interface244: TLS Application-Layer Protocol Negotiation Extension245: Validate JVM Command-Line Flag Arguments246: Leverage CPU Instructions for GHASH and RSA247: Compile for Older Platform Versions248: Make G1 the Default Garbage Collector249: OCSP Stapling for TLS250: Store Interned Strings in CDS Archives251: Multi-Resolution Images252: Use CLDR Locale Data by Default253: Prepare JavaFX UI Controls & CSS APIs for Modularization254: Compact Strings255: Merge Selected Xerces 2.11.0 Updates into JAXP256: BeanInfo Annotations257: Update JavaFX/Media to Newer Version of GStreamer258: HarfBuzz Font-Layout Engine

Page 6: JDK9 Features (Summary, 31/Jul/2015) #JJUG

What features will come?102: Process API Updates110: HTTP 2 Client143: Improve Contended Locking158: Unified JVM Logging165: Compiler Control193: Variable Handles197: Segmented Code Cache199: Smart Java Compilation, Phase Two201: Modular Source Code211: Elide Deprecation Warnings on Import Statements212: Resolve Lint and Doclint Warnings213: Milling Project Coin214: Remove GC Combinations Deprecated in JDK 8215: Tiered Attribution for javac216: Process Import Statements Correctly217: Annotations Pipeline 2.0219: Datagram Transport Layer Security (DTLS)220: Modular Run-Time Images221: Simplified Doclet API222: jshell: The Java Shell (Read-Eval-Print Loop)223: New Version-String Scheme224: HTML5 Javadoc226: UTF-8 Property Files227: Unicode 7.0228: Add More Diagnostic Commands229: Create PKCS12 Keystores by Default230: Microbenchmark Suite231: Remove Launch-Time JRE Version Selection232: Improve Secure Application Performance233: Generate Run-Time Compiler Tests Automatically235: Test Class-File Attributes Generated by javac236: Parser API for Nashorn237: Linux/AArch64 Port240: Remove the JVM TI hprof Agent241: Remove the jhat Tool243: Java-Level JVM Compiler Interface244: TLS Application-Layer Protocol Negotiation Extension245: Validate JVM Command-Line Flag Arguments246: Leverage CPU Instructions for GHASH and RSA247: Compile for Older Platform Versions248: Make G1 the Default Garbage Collector249: OCSP Stapling for TLS250: Store Interned Strings in CDS Archives251: Multi-Resolution Images252: Use CLDR Locale Data by Default253: Prepare JavaFX UI Controls & CSS APIs for Modularization254: Compact Strings255: Merge Selected Xerces 2.11.0 Updates into JAXP256: BeanInfo Annotations257: Update JavaFX/Media to Newer Version of GStreamer258: HarfBuzz Font-Layout Engine

( ゚д゚ )

Page 7: JDK9 Features (Summary, 31/Jul/2015) #JJUG

Give it a once-over!

•This color’s feature is important for ME who develop the product depends on JVM.

•This color’s feature is interesting for someone who develop java applications.

•Good feature. But not affects on me.

Page 8: JDK9 Features (Summary, 31/Jul/2015) #JJUG

102: Process API Updates

•Do you want information about process? ok, here is.

Page 9: JDK9 Features (Summary, 31/Jul/2015) #JJUG

110: HTTP 2 Client

•Do you want API for HTTP/2 ? ok, here is.

Page 10: JDK9 Features (Summary, 31/Jul/2015) #JJUG

143: Improve Contended Locking

•Good speed for contended java object monitors.

•JVM will get a better performance without change of your codes.

•But, HeapStats (includes thread monitor) developers may be required hard work.

Page 11: JDK9 Features (Summary, 31/Jul/2015) #JJUG

158: Unified JVM Logging

•Shall we unify the log format of JVM: e.g. compiler, gc, classload, metaspace, etc...• If you develop log parser, watch it.

•Xlog[:[<what>][:[<output>][:[<decorators>][:<output-options>]]]]

•Xlog:gc=debug:file=gc.log:uptimemillis,pids:filecount=5,filesize=1024

Page 12: JDK9 Features (Summary, 31/Jul/2015) #JJUG

165: Compiler Control

• I WANNA CONTROL COMPILER MORE DETAIL!

•You (probably JVM tester) can•add some order when specified

method is being compiled (for c1 and c2).• print assembly, set breakpoint,

enable compile or not, and more.

•change the option sets while run

Page 13: JDK9 Features (Summary, 31/Jul/2015) #JJUG

193: Variable Handles

•sun.misc.Unsafe may be removed.

•So we prepare the alternatives. This JEP is the first step for it.

Page 14: JDK9 Features (Summary, 31/Jul/2015) #JJUG

(おまけ) sun.misc.Unsafe 動向• 6/15-16 に行われた JCP Executive Committee Meeting で隠蔽・削除

に向けた影響や代替方法などの話し合いが行われた• 元々 sun.* 等は Jigsaw(module化) 関係で処遇を決める必要があった

• JCP Meeting の議題はここ、Unsafeに関する議事録はここ。

• この代替方法の最初のステップとして先の VarHandles が提案され、つい最近(7月)に JDK9 に盛り込まれることが決まった• VarHandles Project 詳細 (JVM Language Summit 2014)

http://www.oracle.com/technetwork/java/jvmls2014sandoz-2265216.pdf

• 今のところは• sun.misc.Unsafe などが deprecated / removed される時期は未明

• sun.misc.Unsafe を含む重要な内部 API はJDK9 では隠蔽のみ、JDK10 では削除したいという方向に議論が進んでいる (ソース:ML, JEP260)

• 代替方法も提案されているが実際に実装が揃うのはこれから

• という状況なので、JDK9 で使う方法を含めた具体的な実装はまだこれからですが、準備は意識した方が良いです。Feature Complete で確認しましょう :) なお、黒魔術なので仕組みを理解してから使いましょう

Page 15: JDK9 Features (Summary, 31/Jul/2015) #JJUG

197: Segmented Code Cache

•Code cache diet.

•JVM will get a better performance without change of your codes.

Page 16: JDK9 Features (Summary, 31/Jul/2015) #JJUG

199: Smart Java Compilation, Phase Two

•sjavac.

Page 17: JDK9 Features (Summary, 31/Jul/2015) #JJUG

201: Modular Source Code

•JDK source code into modules.•A part of Project Jigsaw.

•If you read OpenJDK source code, you need to remake your nautical table :p

Page 18: JDK9 Features (Summary, 31/Jul/2015) #JJUG

211: Elide Deprecation Warnings on Import Statements

•Lint warnings is cry-wolf?

•javac always show warning when you import statement which include a deprecated method or member.

•So resolve it.

Page 19: JDK9 Features (Summary, 31/Jul/2015) #JJUG

212: Resolve Lint and DoclintWarnings

•To clean lint and doclinterrors of some JDK components.

Page 20: JDK9 Features (Summary, 31/Jul/2015) #JJUG

213: Milling Project Coin

•Add language changes.•@SafeVargs on private methods

• non-overridable executable.

• improve try-with-resource• allow effectively final variables to

be used as resources.

•Allow diamond with anonymous classes if the argument type of the inferred type is denotable.•and more two coins.

Page 21: JDK9 Features (Summary, 31/Jul/2015) #JJUG

214: Remove GC Combinations Deprecated in JDK 8

•Good bye following GC Combi.•DefNew + CMS•ParNew + SerialOld•DefNew + iCMS•ParNew + iCMS•CMS foreground(s)

• UseCMSCompactAtFullCollection• CMSFullGCsBeforeCompaction• UseCMSCollectionPassing

Page 22: JDK9 Features (Summary, 31/Jul/2015) #JJUG

215: Tiered Attribution for javac

•New type checking in javac.

•If you have interest in “type” in compiler, you should read this implementation.

Page 23: JDK9 Features (Summary, 31/Jul/2015) #JJUG

216: Process Import Statements Correctly

•Fix javac.

Page 24: JDK9 Features (Summary, 31/Jul/2015) #JJUG

217: Annotations Pipeline 2.0

•javac again.

Page 25: JDK9 Features (Summary, 31/Jul/2015) #JJUG

219: Datagram Transport Layer Security (DTLS)

•API for DTLS 1.0 (RFC 4347) and DTLS 1.2 (RFC 6347)

Page 26: JDK9 Features (Summary, 31/Jul/2015) #JJUG

220: Modular Run-Time Images

•Restructure the JDK and JRE to accommodate modules. •A main part of Project Jigsaw

•Many risks and impacts•no longer contain the files

• lib/rt.jar, lib/tools.jar, lib/dt.jar,..

•Class loader of some existing packages will change, and more.

•But very useful for many Dev.

Page 27: JDK9 Features (Summary, 31/Jul/2015) #JJUG

221: Simplified Doclet API

•Replace Docklet API(com.sun.javadoc) .

Page 28: JDK9 Features (Summary, 31/Jul/2015) #JJUG

222: jshell: The Java Shell (Read-Eval-Print Loop)

•No need more Test.java!•An interactive tool for Java programming language.

•You can use it already at below.•https://jdk9.java.net/download/

•@bitter_fox joined this project.• (Japanese committer)

Page 29: JDK9 Features (Summary, 31/Jul/2015) #JJUG

223: New Version-String Scheme

•Change version-string format.•Security update 2 times +

Minor update 1 times•Current

• long: 1.8.0_20-b62• short:8u20

•Proposed• long: 9.1.2+62• short:9.1.2• $MAJOR.$MINOR.$SECURITY

Page 30: JDK9 Features (Summary, 31/Jul/2015) #JJUG

224: HTML5 Javadoc

http://www.w3.org/html/logo/

Page 31: JDK9 Features (Summary, 31/Jul/2015) #JJUG

226: UTF-8 Property Files

•You will be enable to use UTF-8 property files.

Page 32: JDK9 Features (Summary, 31/Jul/2015) #JJUG

227: Unicode 7.0

•You will..( see title.

Page 33: JDK9 Features (Summary, 31/Jul/2015) #JJUG

228: Add More Diagnostic Commands

•Add below commands•print_class_summary (loaded classes)•print_codegenlist (method queued)•print_vm_state•print_uft8pool•datadump_request (heapdump?)•dump_codelist (n-methods)•print_codeblocks (code cache)•set_vmflag

Page 34: JDK9 Features (Summary, 31/Jul/2015) #JJUG

229: Create PKCS12 Keystoresby Default

•Improve security.

Page 35: JDK9 Features (Summary, 31/Jul/2015) #JJUG

230: Microbenchmark Suite

•JMH++•Add a basic suite of

microbenchmark to JDK codes.

Page 36: JDK9 Features (Summary, 31/Jul/2015) #JJUG

231: Remove Launch-Time JRE Version Selection

•Remove forgotten options.•“-version:” option•Not “-version” option

•“JRE-Version” manifest entry at jar file.

Page 37: JDK9 Features (Summary, 31/Jul/2015) #JJUG

232: Improve Secure Application Performance

•Good speed with a security manager installed.

Page 38: JDK9 Features (Summary, 31/Jul/2015) #JJUG

233: Generate Run-Time Compiler Tests Automatically

•Generate jtreg-compatible automatically for openjdkdevelopers.

•If you want to evaluate JVM with new CPU instructions, optimizations, and other enhancements, generated tests should be useful.

Page 39: JDK9 Features (Summary, 31/Jul/2015) #JJUG

235: Test Class-File Attributes Generated by javac

•yes, javac.

Page 40: JDK9 Features (Summary, 31/Jul/2015) #JJUG

236: Parser API for Nashorn

•To get IDE support for Nashorn.

Page 41: JDK9 Features (Summary, 31/Jul/2015) #JJUG

237: Linux/AArch64 Port

•ARM®

Page 42: JDK9 Features (Summary, 31/Jul/2015) #JJUG

240: Remove the JVM TI hprofAgent

•Good bye hprof

•See also (alternatives)•OProfile•perf•YourKit•SystemTap (for debug)

Page 43: JDK9 Features (Summary, 31/Jul/2015) #JJUG

241: Remove the jhat Tool

•Good bye jhat

•See also (alternatives)•Eclipse MAT

Page 44: JDK9 Features (Summary, 31/Jul/2015) #JJUG

243: Java-Level JVM Compiler Interface

•You can trace JVM JIT activity via this interface.

Page 45: JDK9 Features (Summary, 31/Jul/2015) #JJUG

244: TLS Application-Layer Protocol Negotiation Extension

•javax.net.ssl package supports the TLS ALPN.

•This feature relates to HTTP/2 support (JEP110).

Page 46: JDK9 Features (Summary, 31/Jul/2015) #JJUG

245: Validate JVM Command-Line Flag Arguments

•For example, some JVM flag takes an out-of-range value, and crashes without an informative error message.

•So fix it.

Page 47: JDK9 Features (Summary, 31/Jul/2015) #JJUG

246: Leverage CPU Instructions for GHASH and RSA

•Good security with a low overhead.

Page 48: JDK9 Features (Summary, 31/Jul/2015) #JJUG

246: Leverage CPU Instructions for GHASH and RSA

•Good security with a low overhead.• for SPARC and Intel x64 CPU.

Page 49: JDK9 Features (Summary, 31/Jul/2015) #JJUG

247: Compile for Older Platform Versions

•javac for older.

Page 50: JDK9 Features (Summary, 31/Jul/2015) #JJUG

248: Make G1 the Default Garbage Collector

•Oracle says “G1 is good”.

•Huge impact to a operation by default JVM options.

•But I think that all listeners set a configuration to use specified GC. So this change does not impact you.

•Really?

Page 51: JDK9 Features (Summary, 31/Jul/2015) #JJUG

249: OCSP Stapling for TLS

•TLS. Support RFC 6961.

Page 52: JDK9 Features (Summary, 31/Jul/2015) #JJUG

250: Store Interned Strings in CDS Archives

•Interned String will be stored in Class-Data Sharing when G1GC used.

•A history of a housing•Permanent Gen (JDK6)•Java Heap (JDK7-8)•Class-Data Sharing (JDK9+G1)

Page 53: JDK9 Features (Summary, 31/Jul/2015) #JJUG

251: Multi-Resolution Images

•A new java.awt.image API for multi-resolution image.

y

y/2x/2

x

Page 54: JDK9 Features (Summary, 31/Jul/2015) #JJUG

252: Use CLDR Locale Data by Default

•Use locale data from the Unicode Common Locale Data Repository.

Page 55: JDK9 Features (Summary, 31/Jul/2015) #JJUG

253: Prepare JavaFX UI Controls & CSS APIs for Modularization

•To clean around JavaFX to prepare for Project Jigsaw.

Page 56: JDK9 Features (Summary, 31/Jul/2015) #JJUG

254: Compact Strings

•String class diet.

Page 57: JDK9 Features (Summary, 31/Jul/2015) #JJUG

255: Merge Selected Xerces2.11.0 Updates into JAXP

•To update JAXP from Xerces2.7.1 to 2.11.0.

Page 58: JDK9 Features (Summary, 31/Jul/2015) #JJUG

256: BeanInfo Annotations

•Replace @beaninfo .•@interface JavaBean {…}•@interface BeanProperty {…}•@interface SwingContainer{…}

Page 59: JDK9 Features (Summary, 31/Jul/2015) #JJUG

257: Update JavaFX/Media to Newer Version of GStreamer

•Update GStreamer.•GStreamer: multimedia framework.

Page 60: JDK9 Features (Summary, 31/Jul/2015) #JJUG

258: HarfBuzz Font-Layout Engine

•Replace OpenType font-layout engine from ICU to HarfBuzz.

Page 61: JDK9 Features (Summary, 31/Jul/2015) #JJUG

Important features for me.

•sun.misc.Unsafe alternatives.

•G1GC by default.

•Project Jigsaw.

•JIT compiler is more friendly.

•jshell