Java 14 - Other Enhancements

JEP 349 - JFR Event Streaming

JEP 349 enhances JDK Flight Recorder data to continuous monitoring for in-process as well as out-of-process applications.

Till Java 13, in order to use JFR data, user need to start a recording, stop and dump the content to disk and then parse the recording file. This approach is well suited for application profiling but on for monitoring.

Now the package jdk.jfr.consumer is enhanced to subscribe to events asynchronously. Using this subscription, User can read recording data directly, or stream, from the disk repository without a need to dump a recording file.

JEP 352 - Non-Volatile Mapped Byte Buffers

With this JEP, Java 13 adds a new JDK-specific file mapping mode to allow FileChannel API usage to create a MappedByteBuffer instance and Non-volatile memory can be accessed. Non-Volatile Memory or NVM is a persistent memory and is used to store data permanently.

Now MappedByteBufer API supports direct memory updates and provides a durability guarantee which is required for higher level APIs like block file systems, journaled logs, persistent objects, etc to implement persistent data types.

JEP 370 - Foreign-Memory Access API

Java 14 now allows java programs to safely and efficiently access foreign memory outside of the Java heap. Earlier mapDB, memcached java libraries provided the foreign memory access. This JEP aims to provide a cleaner API to operate on all types of foreign memories(native memory, persistent memory, managed heap memory etc. ) in a seamless way. This JEP takes care of safety of JVM regardless of foreign memory type. Garbage collection/Memory deallocation operations should be explicitly mentioned as well.

This API is based on three main abstractions MemorySegment, MemoryAddress and MemoryLayout and is a safe way to access both heap as well as non-heap memory.