The release of Java 10 early this year brought several new improvements for the programming language. It came just 6 months after its predecessor but brought considerable enhancement in its features. Now that Java 11 is just around the corner, all those who have not already moved to Java 10 need to make it fast so that they can be geared up for the upcoming version. So wouldn’t you be interested in knowing more about Java 10 features and how a move can be beneficial for your business. Let’s check out all the features of this version and know it better.
1. Local Variable Type Inference (JEP 286)
2. Time-Based Release Versioning (JEP 322)
This new feature, as the name suggests, adopts a time-based release cycle with a revised version-string scheme of the JDK and the Java SE Platform. The language will come now have a six-month release model. Even though some may not consider this as a practical approach, it is always good to have new features in every few months.
3. Heap Allocation on Alternative Memory Devices (JEP 316)
This feature helps the HotSpot VM in allocating the Java object heap on an alternative memory device, which has specified by the user. For instance, it will enable a multi-JVM environment to allocate all the higher priority processes to the DRAM, while the lower priority processes will be assigned the NV-DIMM memory.
4. Garbage-Collector Interface (JEP 304)
This Java 10 feature increases the code isolation of different garbage collectors and comes up with a clean interface for them. There are several benefits of this feature, such as it facilitates the exclusion of a GC from a JDK build and also makes it easy to add a new GC without having an impact on the code base.
5. Parallel Full GC for G1 (JEP 307)
In Java 9 version, G1 was the default GC and was designed to avoid full collections; however, it would fall back on a full GC when the concurrent collections could not reclaim memory quickly enough. The new version parallelizes the full GC algorithm to ensure that the same number of threads are used as in the concurrent collections in case of a G1 Full GC to improve the overall performance.