Posts

Showing posts from November, 2018

4 New JEPs Proposed for Java 12

Four JEPs have just been proposed for JDK 12 and they are briefly summarized in this post based on the JEPs' own text descriptions. JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental) JEP 189 ["Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)"] is described as "a new garbage collection (GC) algorithm ... [that] reduces GC pause times by doing evacuation work concurrently with the running Java threads." The JEP text adds, "Shenandoah is an appropriate algorithm for applications which value responsiveness and predictable short pauses." JEP 334: JVM Constants API JEP 334 ["JVM Constants API"]'s "Summary" states that this JEP's goal is to "Introduce an API to model nominal descriptions of key class-file and run-time artifacts, in particular constants that are loadable from the constant pool." This JEP is also proposed for Java SE 12 . JEP 344: Abortable Mixed Collections for G1 ...

Project Atlantis Proposed for JDK Performance Monitoring and Analysis Improvement Experimentation

The thread " Call For Discussion: New Project: Atlantis " on the OpenJDK discuss mailing list discusses JC Beyler 's proposal of an OpenJDK project called " Project Atlantis " that "would provide a venue to explore and incubate monitoring and performance analysis features that could be integrated into the Hotspot JVM and the JVM Tool Interface." This proposed project would include "working, evaluating, and incubating a Thread-Sanitizer implementation for Java." Beyler's proposal provides background for this proposed project based on work done at Google: The Google platform team has historically worked on providing new features, including monitoring hooks due to certain monitoring features not being available in a low-overhead, turned on-by-default manner. Therefore, for Google Java users, the platform team augmented or added mechanisms to assess various metrics such as but not limited to: Thread Sanitizer support for Java (see JDK-8...

JDK 12's Files.mismatch Method

JDK 12 introduces a new method to the Files class . The method, Files.mismatch(Path,Path) , has been introduced to JDK 12 via JDK-8202302 and is available in JDK 12 Early Access Build 20 (same early access build that supports the new {@systemProperty} Javadoc tag ). JDK-8202302 ["(fs) New Files.mismatch method for comparing files"] adds the Files.mismatch(Path,Path) method "to compare the contents of two files to determine whether there is a mismatch between them" and can be used to determine "whether two files are equal." There was talk at one time of adding a Files.isSameContent() method , but it was decided to use Files.mismatch(Path,Parh) because of its consistency "with the Arrays.mismatch and Buffer.mismatch methods." The next code listing contains a simple Java class that demonstrates the new Files.mismatch(Path,Path) and contrasts it with Files.isSameFile(Path,Path) . package dustin.examples.jdk12.files; import java.nio.file.F...

JDK 12 Javadoc Tag for System Properties

Image
JDK 12 Early Access Build 20 ( 2018/11/15 ) is available and can be used to try out the new Javadoc tag {@systemProperty} . The new {@systemProperty} Javadoc tag is discussed in the core-libs-dev mailing list message " FYI: new javadoc tag to document system properties " and was introduced in response to JDK-5076751 ["System properties documentation needed in javadocs"]. The {@systemPropery} Javadoc tag displays its contents as normal text in its generated output and makes the contents available to the Javadoc search introduced with JDK 9 . This tag is intended to be used for documenting an application's system properties . The following simple class will be used to demonstrate the new JDK 12 Javadoc tag {@systemProperty} : package dustin.examples.jdk12.properties; import static java.lang.System.out; /** * Class with sole purpose to illustrate JDK 12's * support for {@literal {@systemProperty}}. */ public class PropertiesDemo { /** * {@syst...

Amazon Corretto: Another No-Cost JDK

Image
In the blog post " A Tale of Two Oracle JDKs ," I compared and contrasted the two JDKs provided by Oracle: Oracle OpenJDK and Oracle JDK (Java SE) . There are numerous other JDK offerings available, most of which are based on OpenJDK . One of these is Amazon Corretto , which is the subject of this post. Today's " What's New with AWS " post " Introducing Amazon Corretto (Preview) " announces Amazon Corretto as "a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK)." Amazon Corretto 's main page describes what it has to offer: "Corretto comes with long-term support that will include performance enhancements and security fixes." This is significant because it advertises that Amazon will provide performance enhancements and security fixes to its JDK offerings past the 6 months for which Oracle has committed to making performance enhancements and security fixes to each new OpenJDK v...