问题
Does anyone know if there is a version of the Java 10 and JVM 10 specifications with diffs from the previous version available? For Java 8 and Java 9, there were specifications with diffs, and it's very difficult to see what exactly changed otherwise.
回答1:
For differences between Java 9 and Java 10 (18.3), you can download "JSR-000383 Java SE 10 (18.3) Final Release Annex 3 for Evaluation" with the following link:
- http://download.oracle.com/otndocs/jcp/java_se-10-final-eval-spec/index.html
Keep in mind, you must accept the Software License Agreement to download it.
This archive contains the differences for both the JLS and JVMS.
回答2:
I know what Java 10 has new, let's have a quick look in brief.
1. Local Variable Type Inference (JEP 286) Similar to JavaScript, Kotlin, and Scala, now Java will also have a var keyword that allows you to declare a local variable without specifying its type example : var name = "Java"
2. Garbage-Collector Interface (JEP 304) It increases code isolation of different garbage collectors and introduces a clean interface for them.This means it is easier to exclude a GC from a JDK build while also making it easier to add a new GC without it affecting the code base.
3. Parallel Full GC for G1 (JEP 307) It improves G1 worst-case latencies by making the full GC parallel, If you remember from Java 9's release, G1 was made the default GC for the JVM, which was designed to avoid full GC. But when the concurrent collections couldn't reclaim memory quickly enough, it would end up falling back on a full GC, and that creates a problem.This change will parallelize the full GC algorithm so that in the unlikely event of a G1 Full GC, the same number of threads can be used as in the concurrent collections to improve overall performance.
4. Heap Allocation on Alternative Memory Devices (JEP 316) It enables the HotSpot VM to allocate the Java object heap on an alternative memory device, specified by the user.For example, this feature makes it possible to assign lower priority processes to use the NV-DIMM memory, and instead only allocate the higher priority processes to the DRAM in a multi-JVM environment.
5. Consolidate the JDK Forest Into a Single Repository (JEP 296) It will combine the numerous repositories of the JDK forest into a single repository.
6. Experimental Java-Based JIT Compiler (JEP 317) enables the Java-based JIT compiler, Graal, to be used as an experimental JIT compiler on the Linux/x64 platform.If you remember, Graal was already added back in Java 9, but now you can enable it with the following JVM arguments:
-XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler
7. Thread-Local Handshakes (JEP 312) improved VM performance by making it possible to execute a callback on application threads without performing a global VM savepoint. This would mean that the JVM could stop individual threads and not just all of them.
8. Remove the Native-Header Generation Tool (JEP 313) It will remove the javah tool from the JDK, a separate tool to generate header files when compiling JNI code, as this can be done through javac.
Source/Credit : Java 10 Features
来源:https://stackoverflow.com/questions/49459990/jvm-10-specification-with-diffs