SlideShare a Scribd company logo
1 of 12
Download to read offline
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
What’s new in the JVM
in Java SE 8
Gil Tene, CTO & co-Founder, Azul Systems
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
About me: Gil Tene
co-founder, CTO
@Azul Systems

Have been working on JVMs
and on “think different” GC
approaches since 2002

Created Pauseless & C4 core
GC algorithms (Tene, Wolf)

A Long history building
Virtual & Physical Machines,
Operating Systems,
Enterprise apps, etc...

JCP EC Member...
* working on real-world trash compaction issues, circa 2004
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
About Azul
We make scalable Virtual
Machines

Have built “whatever it takes to
get job done” since 2002

3 generations of custom SMP
Multi-core HW (Vega)

Zing: Pure software for
commodity x86

Known for Low Latency,
Consistent execution, and Large
data set excellence
Vega
C4
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
©2013 Azul Systems, Inc.	
 	
 	
 	
 	
 	
About Azul
We also do other things with
JVMs...

Zulu: A commercialized,
supported version of
OpenJDK

Long term, commercial
support for Java SE 6, Java
SE 7, (and 8 as it comes out)

Free & Open Source, with
changes contributed back to
OpenJDK

Windows & Linux . . .

Azure & EC2 . . .
C4
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
This talk will focus on the JVM
Java SE 8 brings many changes

JDK

JVM

Specific implementation considerations (OpenJDK, etc.)

!
We will focus on the JVM, with some notes about
major pushes in specific implementations
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Semantic changes for the JVM
Not that many…

Lambda Expressions, Virtual Extension Methods
(JEP126)

Parameter Reflection (JEP118)

Type annotation (JSR 308)

Class file format changes (version 52.0)
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Lambda Expressions
Lambda Expressions, Virtual Extension Methods

JDK: Parallel Collections, Stream API

Semantic Implications for the JVM:

Leverages JSR292 (already there in Java SE 7)

New (in Java SE 8) Virtual Extension Methods
support Default Methods capability in interfaces
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Lambda Expressions: Performance
JDK and generic user code will now make heavy use of JSR292,
InvokeDynamic, Method Handles

Performance of Lambda expressions and MethodHandles becomes critical

Specific (OpenJDK, Java SE 8 RI) Implementation note: 

Drove a new Lambda-Form implementation of Method Handle 

Lambda-Form based implementation shifts much of the previously
hard-wired JVM MethodHandle implementation to generated Java code
that is then JIT-compiled and optimized at runtime.

Drove changes to JIT inlining policies and heuristics

“Late inlining” added to support the deep inlining needed for
performant Lamda-Form execution
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Some Implementation-specific notes
OpenJDK 8 (Java SE 8 RI) brings some additional implementation-specific
changes:

E.g. Enhanced Verification Errors (JEP136) 

E.g. Improved Intrinsic support for atomics and fences

Unsafe adds intrinsic support for getAndAddX, getAndSetX.

JDK Atomic APIS implementations replace CAS-loops for some common
atomic operations with single call (translates to single instruction on
e.g. x86).

New Unsafe intrinsics for ordering/fencing (JEP171). No (pure, safe)
Java APIs exposed yet.

E.g. Leveraging CPU instructions for AES cryptography (JEP164)
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Some Implementation-specific notes

(Cont.)
Some internally useful performance-affecting annotations

E.g. (internal, for trusted code) support for @Stable

enables contant folding for lazily evaluated variables

improves performance in trusted JDK code

“Dangerous” to expose to non-trusted code…

E.g. (internal, for trusted code) support for @Contended (JEP142) 

Facilitates cache-layout for contended fields

Helps avoid false-sharing bottlenecks in concurrent code

Currently available only in JDK (security concerns)

Will hopefully be made more widely available in the future
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Some Implementation-specific notes
(cont.): PermGen
Removal of PermGen, replaced with MetaSpace (JEP122)

Major change in JVM-internal handling of long lived, class-related information

Intended to reduce GC-related and fixed-size issues historically associated with
PermGen

New MetaSpace is separate from Java heap. Still garbage collected but with
specific sematics

Expected to alleviate issues around running out of PermGen space and thrashing
GC when PermGen come under pressure due to class loading activity.

New class loading pressure expected due to Lamda-Form use is a potential driver 

Note: This is specific to OpenJDK and the RI, and is not a Java SE 8 feature
item. Other JVMs (e.g. Zing) that provide an elastic, configuration-free, and
pause-free PermGen will not need the new MetaSpace.
©2011 Azul Systems, Inc.	
 	
 	
 	
 	
 	
Summary
Java SE 8 includes major changes to the language & libraries

The majority of these changes are in the JDK (library code, written in Java) and in the
surrounding tools (e.g. javac)

The JVM is changing in small increments

Semantic changes are mostly around default methods in interfaces, and type
annotations (both drive class file change)

JVM implementations (including OpenJDK 8, the Java SE 8 RI):

Performance changes are driven by expectation for heavy use of JSR292

Many of the internal performance changes are not specific to Java SE 8, and use it
mostly as a release as a release vehicle

Expect significant additional performance and footprint work (around Lambda-Forms,
etc.) to appear in updates over time.

More Related Content

What's hot

JavaFX and JEE 7
JavaFX and JEE 7JavaFX and JEE 7
JavaFX and JEE 7
Vijay Nair
 

What's hot (20)

Jakarta EE 最前線 - Jakarta EEの現在、ロードマップなど
Jakarta EE 最前線 - Jakarta EEの現在、ロードマップなどJakarta EE 最前線 - Jakarta EEの現在、ロードマップなど
Jakarta EE 最前線 - Jakarta EEの現在、ロードマップなど
 
JDK 9 Java Platform Module System
JDK 9 Java Platform Module SystemJDK 9 Java Platform Module System
JDK 9 Java Platform Module System
 
JavaFX and JEE 7
JavaFX and JEE 7JavaFX and JEE 7
JavaFX and JEE 7
 
The latest features coming to Java 12
The latest features coming to Java 12The latest features coming to Java 12
The latest features coming to Java 12
 
JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?JDK 9: Mission Accomplished. What Next For Java?
JDK 9: Mission Accomplished. What Next For Java?
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
JDK-9: Modules and Java Linker
JDK-9: Modules and Java LinkerJDK-9: Modules and Java Linker
JDK-9: Modules and Java Linker
 
GlassFish in Production Environments
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production Environments
 
Java 9 Modularity and Project Jigsaw
Java 9 Modularity and Project JigsawJava 9 Modularity and Project Jigsaw
Java 9 Modularity and Project Jigsaw
 
JEE Course - JEE Overview
JEE Course - JEE  OverviewJEE Course - JEE  Overview
JEE Course - JEE Overview
 
WebLogic Developer Experience and Java EE 6
WebLogic Developer Experience and Java EE 6WebLogic Developer Experience and Java EE 6
WebLogic Developer Experience and Java EE 6
 
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
 
JavaFX Uni Parthenope
JavaFX Uni ParthenopeJavaFX Uni Parthenope
JavaFX Uni Parthenope
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in action
 
Ausoug glassfish perth
Ausoug glassfish perthAusoug glassfish perth
Ausoug glassfish perth
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
Glassfish An Introduction
Glassfish An IntroductionGlassfish An Introduction
Glassfish An Introduction
 

Similar to What's New in the JVM in Java 8?

10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
Martin Fousek
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7
Vinay H G
 
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
mfrancis
 
PaaS on Openstack
PaaS on OpenstackPaaS on Openstack
PaaS on Openstack
Open Stack
 

Similar to What's New in the JVM in Java 8? (20)

Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
 
Java History - MyExamCloud Presentation
Java History - MyExamCloud PresentationJava History - MyExamCloud Presentation
Java History - MyExamCloud Presentation
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Java Version History.pdf
Java Version History.pdfJava Version History.pdf
Java Version History.pdf
 
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 201310 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
10 Tips for Java EE 7 with PrimeFaces - JavaOne 2013
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
 
BP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM DominoBP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM Domino
 
Java 9 and Beyond
Java 9 and BeyondJava 9 and Beyond
Java 9 and Beyond
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
 
Jetty Vs Tomcat
Jetty Vs TomcatJetty Vs Tomcat
Jetty Vs Tomcat
 
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
We Can Do Better - IBM's Vision for the Next Generation of Java Runtimes - Jo...
 
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
 
Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1Haj 4344-java se 9 and the application server-1
Haj 4344-java se 9 and the application server-1
 
EmbeddedJavaSmall.ppt
EmbeddedJavaSmall.pptEmbeddedJavaSmall.ppt
EmbeddedJavaSmall.ppt
 
Proposed Java 5 API for DDS (out of date)
Proposed Java 5 API for DDS (out of date)Proposed Java 5 API for DDS (out of date)
Proposed Java 5 API for DDS (out of date)
 
PaaS on Openstack
PaaS on OpenstackPaaS on Openstack
PaaS on Openstack
 

More from Azul Systems, Inc.

More from Azul Systems, Inc. (10)

Unleash the Power of Apache Cassandra
Unleash the Power of Apache CassandraUnleash the Power of Apache Cassandra
Unleash the Power of Apache Cassandra
 
How NOT to Measure Latency
How NOT to Measure LatencyHow NOT to Measure Latency
How NOT to Measure Latency
 
Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015
Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015
Enabling Java in Latency Sensitive Environments - Dallas JUG April 2015
 
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
Enabling Java in Latency-Sensitive Environments - Austin JUG April 2015
 
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVMQCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
QCon London: Low latency Java in the real world - LMAX Exchange and the Zing JVM
 
JVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentationJVM Language Summit: Object layout presentation
JVM Language Summit: Object layout presentation
 
JVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshopJVM Language Summit: Object layout workshop
JVM Language Summit: Object layout workshop
 
DC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage CollectionDC JUG: Understanding Java Garbage Collection
DC JUG: Understanding Java Garbage Collection
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
Winning With Java at Market Open
Winning With Java at Market OpenWinning With Java at Market Open
Winning With Java at Market Open
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 

What's New in the JVM in Java 8?

  • 1. ©2011 Azul Systems, Inc. What’s new in the JVM in Java SE 8 Gil Tene, CTO & co-Founder, Azul Systems
  • 2. ©2013 Azul Systems, Inc. About me: Gil Tene co-founder, CTO @Azul Systems Have been working on JVMs and on “think different” GC approaches since 2002 Created Pauseless & C4 core GC algorithms (Tene, Wolf) A Long history building Virtual & Physical Machines, Operating Systems, Enterprise apps, etc... JCP EC Member... * working on real-world trash compaction issues, circa 2004
  • 3. ©2013 Azul Systems, Inc. ©2013 Azul Systems, Inc. About Azul We make scalable Virtual Machines Have built “whatever it takes to get job done” since 2002 3 generations of custom SMP Multi-core HW (Vega) Zing: Pure software for commodity x86 Known for Low Latency, Consistent execution, and Large data set excellence Vega C4
  • 4. ©2013 Azul Systems, Inc. ©2013 Azul Systems, Inc. About Azul We also do other things with JVMs... Zulu: A commercialized, supported version of OpenJDK Long term, commercial support for Java SE 6, Java SE 7, (and 8 as it comes out) Free & Open Source, with changes contributed back to OpenJDK Windows & Linux . . . Azure & EC2 . . . C4
  • 5. ©2011 Azul Systems, Inc. This talk will focus on the JVM Java SE 8 brings many changes JDK JVM Specific implementation considerations (OpenJDK, etc.) ! We will focus on the JVM, with some notes about major pushes in specific implementations
  • 6. ©2011 Azul Systems, Inc. Semantic changes for the JVM Not that many… Lambda Expressions, Virtual Extension Methods (JEP126) Parameter Reflection (JEP118) Type annotation (JSR 308) Class file format changes (version 52.0)
  • 7. ©2011 Azul Systems, Inc. Lambda Expressions Lambda Expressions, Virtual Extension Methods JDK: Parallel Collections, Stream API Semantic Implications for the JVM: Leverages JSR292 (already there in Java SE 7) New (in Java SE 8) Virtual Extension Methods support Default Methods capability in interfaces
  • 8. ©2011 Azul Systems, Inc. Lambda Expressions: Performance JDK and generic user code will now make heavy use of JSR292, InvokeDynamic, Method Handles Performance of Lambda expressions and MethodHandles becomes critical Specific (OpenJDK, Java SE 8 RI) Implementation note: Drove a new Lambda-Form implementation of Method Handle Lambda-Form based implementation shifts much of the previously hard-wired JVM MethodHandle implementation to generated Java code that is then JIT-compiled and optimized at runtime. Drove changes to JIT inlining policies and heuristics “Late inlining” added to support the deep inlining needed for performant Lamda-Form execution
  • 9. ©2011 Azul Systems, Inc. Some Implementation-specific notes OpenJDK 8 (Java SE 8 RI) brings some additional implementation-specific changes: E.g. Enhanced Verification Errors (JEP136) E.g. Improved Intrinsic support for atomics and fences Unsafe adds intrinsic support for getAndAddX, getAndSetX. JDK Atomic APIS implementations replace CAS-loops for some common atomic operations with single call (translates to single instruction on e.g. x86). New Unsafe intrinsics for ordering/fencing (JEP171). No (pure, safe) Java APIs exposed yet. E.g. Leveraging CPU instructions for AES cryptography (JEP164)
  • 10. ©2011 Azul Systems, Inc. Some Implementation-specific notes (Cont.) Some internally useful performance-affecting annotations E.g. (internal, for trusted code) support for @Stable enables contant folding for lazily evaluated variables improves performance in trusted JDK code “Dangerous” to expose to non-trusted code… E.g. (internal, for trusted code) support for @Contended (JEP142) Facilitates cache-layout for contended fields Helps avoid false-sharing bottlenecks in concurrent code Currently available only in JDK (security concerns) Will hopefully be made more widely available in the future
  • 11. ©2011 Azul Systems, Inc. Some Implementation-specific notes (cont.): PermGen Removal of PermGen, replaced with MetaSpace (JEP122) Major change in JVM-internal handling of long lived, class-related information Intended to reduce GC-related and fixed-size issues historically associated with PermGen New MetaSpace is separate from Java heap. Still garbage collected but with specific sematics Expected to alleviate issues around running out of PermGen space and thrashing GC when PermGen come under pressure due to class loading activity. New class loading pressure expected due to Lamda-Form use is a potential driver Note: This is specific to OpenJDK and the RI, and is not a Java SE 8 feature item. Other JVMs (e.g. Zing) that provide an elastic, configuration-free, and pause-free PermGen will not need the new MetaSpace.
  • 12. ©2011 Azul Systems, Inc. Summary Java SE 8 includes major changes to the language & libraries The majority of these changes are in the JDK (library code, written in Java) and in the surrounding tools (e.g. javac) The JVM is changing in small increments Semantic changes are mostly around default methods in interfaces, and type annotations (both drive class file change) JVM implementations (including OpenJDK 8, the Java SE 8 RI): Performance changes are driven by expectation for heavy use of JSR292 Many of the internal performance changes are not specific to Java SE 8, and use it mostly as a release as a release vehicle Expect significant additional performance and footprint work (around Lambda-Forms, etc.) to appear in updates over time.