Home Java javaTutorial Java 9 features

Java 9 features

Nov 26, 2016 am 09:07 AM
java characteristic

Oracle has announced that the first set of enhancement plans (known as JEPs) for Java 9 has been confirmed to be released in early 2016.

Three new APIs have been announced:

The Process API can interact with non-JAVA related processes in the operating system after the update. The currently used API has many limitations, which forces developers to often resort to native code. The main risk with this API is the heterogeneous nature of operating systems, especially Windows. The design of the API needs to adapt to the deployment of small devices on different operating systems. It should also consider the environment where multiple Java virtual machines run in the same operating system process. These considerations will lead to a more abstract API, which will increase the design workload.

 New HTTP client, introducing support for HTTP/2.

Problems and implementation of existing APIs:

APIs based on URLConnection are designed with multiple protocols in mind, many of which have been abandoned (ftp, gopher, etc.)

Early HTTP 1.1 was too abstract

difficult Usage (many behaviors are not documented)

Can only work in blocking mode (one thread per request/response)

Very difficult to maintain

 Https 2.0 support relies on TLS ALPN (Application Layer Negotiation Extension), currently JDK Not supported in 2014, the HTTP 2.0 specification itself is still in Internet Draft form, but it is expected to become an official draft in 2014.

 New lightweight JSON API: It provides a lightweight API for processing and generating JSON documents and data streams. The latter is based on standardized JSON support and is part of JSR 353.

There are also three JVM and performance-related features announced:

Improved contention locks, designed to improve performance when threads compete to access objects. Improving contention locking would be of great benefit to real-world applications, especially against industrial benchmarks such as Volano and DaCapo.

This project will explore performance improvements in the following areas related to competing Java monitors:

Field reordering and cache line alignment

Speed ​​up PlatformEvent::unpark()

Fast Java monitor entry operations

Fast Java monitor exit operations

Fast Java monitor notify/notifyAll operations

Adaptive spin improvements and SpinPause on SPARC

Split JIT compiler’s code cache ( for better JIT performance on large applications). Breaking the code cache into independent segments, each containing a specific form of compiled code, is intended to improve performance and support future expansion.

 The organization and maintenance of compiled code will have a huge impact on performance. If the code cache goes in the wrong direction, several instances of performance degradation will be known. After the introduction of multi-level compilation, the status of code caching becomes extremely important, because the amount of compiled code will increase by 2-4 times compared with not using multi-level compilation. Multi-level compilation also introduces a new type of compiled code: instrumented compiled code (isolated code). Alien code has different properties from non-profiled code. One important difference is that profiled code has a predefined restricted life cycle, in contrast to non-profiled code, which always remains in the code cache.

Existing code caching is optimized for a single code, that is, there is only one form of compiled code. The code cache is organized as a separate heap data structure located at the head of a contiguous memory block. As a result, profiled code with a predefined restrictive lifetime will be mixed with non-profiled code and remain permanently in the code cache, which introduces different performance and design issues. For example, the sweeper method will be forced to scan the entire code cache when scanning, even if some entities in it are never updated, or there is non-method code.

In-depth development of a "smart" Java compiler, called sjavac, which supports parallel and shared compilation, among other features.

Due to various stability and portability issues, sjavac is not used in JDK build scripts by default. The first goal of this JEP is to solve these issues, which involves ensuring that the tool can always Produces reliable results on all hardware and software configurations.

 The overall goal is to improve the quality of sjavac and make it a universal javac package capable of compiling various large-scale Java projects.

 Follow-up projects will continue to explore how to separate sjavac in the JDK tool chain, if possible. sjavac may become a standalone supported tool, a non-standalone tool integrated with javac, or something else.

Finally, an enticing feature has been promised in JEP 201: modular source code. This is actually what we once knew as the modular solution "Project Jigsaw" (originally targeted as part of Java 8).

 The Jigsaw project aims to design and implement a standardized module system for the Java SE platform, and apply it to its own platform, and then invest it in the JDK. Its initial goals are to make platform implementations more easily scalable to small devices, improve security and maintainability, improve application performance, and provide developers with better tools when faced with large applications.

This JEP is part of the first phase of the Jigsaw project. Next, the JEP will modularize the JRE and JDK images, and then introduce a module system.

The motivation for reorganizing the source code in the early stage is:

To give JDK developers the opportunity to become familiar with the modular structure of the system.

Continue to advance structure by enforcing module boundaries in builds, even before the module system is introduced.

In-depth development of Jigsaw projects instead of always "slowly" converting existing non-modular code into modular code.


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Perfect Number in Java Perfect Number in Java Aug 30, 2024 pm 04:28 PM

Guide to Perfect Number in Java. Here we discuss the Definition, How to check Perfect number in Java?, examples with code implementation.

Weka in Java Weka in Java Aug 30, 2024 pm 04:28 PM

Guide to Weka in Java. Here we discuss the Introduction, how to use weka java, the type of platform, and advantages with examples.

Smith Number in Java Smith Number in Java Aug 30, 2024 pm 04:28 PM

Guide to Smith Number in Java. Here we discuss the Definition, How to check smith number in Java? example with code implementation.

Java Spring Interview Questions Java Spring Interview Questions Aug 30, 2024 pm 04:29 PM

In this article, we have kept the most asked Java Spring Interview Questions with their detailed answers. So that you can crack the interview.

Break or return from Java 8 stream forEach? Break or return from Java 8 stream forEach? Feb 07, 2025 pm 12:09 PM

Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is

TimeStamp to Date in Java TimeStamp to Date in Java Aug 30, 2024 pm 04:28 PM

Guide to TimeStamp to Date in Java. Here we also discuss the introduction and how to convert timestamp to date in java along with examples.

Java Program to Find the Volume of Capsule Java Program to Find the Volume of Capsule Feb 07, 2025 am 11:37 AM

Capsules are three-dimensional geometric figures, composed of a cylinder and a hemisphere at both ends. The volume of the capsule can be calculated by adding the volume of the cylinder and the volume of the hemisphere at both ends. This tutorial will discuss how to calculate the volume of a given capsule in Java using different methods. Capsule volume formula The formula for capsule volume is as follows: Capsule volume = Cylindrical volume Volume Two hemisphere volume in, r: The radius of the hemisphere. h: The height of the cylinder (excluding the hemisphere). Example 1 enter Radius = 5 units Height = 10 units Output Volume = 1570.8 cubic units explain Calculate volume using formula: Volume = π × r2 × h (4

How to Run Your First Spring Boot Application in Spring Tool Suite? How to Run Your First Spring Boot Application in Spring Tool Suite? Feb 07, 2025 pm 12:11 PM

Spring Boot simplifies the creation of robust, scalable, and production-ready Java applications, revolutionizing Java development. Its "convention over configuration" approach, inherent to the Spring ecosystem, minimizes manual setup, allo

See all articles