Showing posts with label Oracle JDK. Show all posts
Showing posts with label Oracle JDK. Show all posts

Wednesday, January 31, 2024

Announcing Oracle GraalVM for JDK 21

Announcing Oracle GraalVM for JDK 21

Oracle is pleased to announce the availability of Oracle GraalVM for JDK 21. This release brings with it new Java 21 features, improvements in Native Image performance, simplified usage of embedded languages, and more.

Project Loom Virtual Threads

First previewed in JDK 19, Project Loom is no longer a preview feature in JDK 21. GraalVM for JDK 21 implements Loom’s virtual threads when running on the JVM and when using Native Image.

Native Image Performance

While executables generated by GraalVM Native Image may be best known for their quick startup time, metrics such as memory usage, peak throughput, and latency are also critically important. With Oracle GraalVM for JDK 21 we see ahead-of-time (AOT) compilation achieving superior results on all metrics when benchmarking the popular Spring PetClinic application. While some developers might expect that JIT compilation would always outperform AOT compilation, the throughput achieved by Native Image generated executables in GraalVM for JDK 21 provide competitive peak performance.

All the following Spring PetClinic benchmark results were obtained with a maximum heap size of 512MB. The two configurations compared below are: a native executable produced by Oracle GraalVM for JDK 21 optimized with profile guided optimization (PGO); the same application running on GraalVM Community Edition for JDK 21 using the C2 JIT compiler. Both configurations use the G1 garbage collector.

Startup (seconds): Native 97% faster

GraalVM (C2 JIT) Oracle GraalVM Native Image (PGO+G1) 
7.09 0.21 

Memory Usage (RSS in MB): Native 38% lower

GraalVM (C2 JIT) Oracle GraalVM Native Image (PGO+G1)
1029 641

99th Percentile Latency (ms): Native 28% lower

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)
7.20 5.15

Throughput (requests/second): On par

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)
11066 11902

With these latest results, we can see that Oracle GraalVM Native Image can provide faster startup time, reduced memory requirements, and lower latency while maintaining throughput making it an ideal choice for microservices, functions, and other workloads where minimizing operating cost is critical.

New Container Images


To support container-based application development and deployment, new container images are available for the Oracle GraalVM JDK and Native Image in the Oracle Container Repository. The `jdk` image can be used to deploy Java applications while the `native-image` container image includes all the tools required to compile applications into native executables.

Faster Compile Times


To reduce application compile times, some optimization phases that were previously included in the default level 2 (-O2) have been moved to a new level 3 (-O3). The level 3 optimizations work best with profile guided optimization, so they are automatically enabled when compiling with `--pgo`. The result is faster default compilation times with no significant impact on application performance. PGO continues to employ the same optimizations as in previous releases.

During development, where the focus is on functionality, not performance, developers can continue to use the “quick build” option (-Ob) to reduce compile times. This option disables most memory and performance optimizations so the resulting executables are not recommended for production deployments.

Source: oracle.com

Wednesday, February 15, 2023

Differences Between Oracle JDK and OpenJDK

Oracle JDK, OpenJDK, Oracle Java Tutorial and Materials, Oracle Java Career, Java Prep, Oracle Java Certification, Java Guides, Java Prep, Oracle Java Preparation

Java has been one of the most popular programming languages in the world for many years, and for good reason. It is versatile, reliable, and scalable, making it an excellent choice for developing everything from small mobile apps to large enterprise systems. However, when it comes to choosing a Java Development Kit (JDK) for your project, you may be wondering what the differences are between Oracle JDK and OpenJDK. In this article, we will explore the key differences between the two JDKs and help you make an informed decision on which one is right for your project.

What is Oracle JDK?


Oracle JDK is the official implementation of Java Standard Edition (Java SE), developed and maintained by Oracle Corporation. It is the original implementation of Java, and it includes all the features and components required to develop, run, and debug Java applications. Oracle JDK is available under a commercial license, which means that if you want to use it for commercial purposes, you will need to purchase a license from Oracle.

What is OpenJDK?


OpenJDK, on the other hand, is an open-source implementation of Java SE, developed and maintained by the Java community. It is an alternative to Oracle JDK, and it includes all the features and components required to develop, run, and debug Java applications. OpenJDK is available under the GNU General Public License, which means that it is free to use for commercial and non-commercial purposes.

Key Differences between Oracle JDK and OpenJDK


1. Licensing

One of the key differences between Oracle JDK and OpenJDK is the licensing. Oracle JDK is available under a commercial license, which means that if you want to use it for commercial purposes, you will need to purchase a license from Oracle. OpenJDK, on the other hand, is available under the GNU General Public License, which means that it is free to use for commercial and non-commercial purposes.

2. Support

Another important difference between Oracle JDK and OpenJDK is the support. Oracle provides commercial support for Oracle JDK, which includes bug fixes, security updates, and technical support. OpenJDK, on the other hand, is community-supported, which means that there is no formal support from any organization. However, many companies and individuals provide community support for OpenJDK, which includes bug fixes, security updates, and technical support.

3. Release Schedule

Oracle JDK and OpenJDK also have different release schedules. Oracle releases a new version of Oracle JDK every six months, and provides support for each version for at least three years. OpenJDK, on the other hand, is released by different vendors, each with its own release schedule. Some vendors release a new version of OpenJDK every six months, while others release it every few years. The length of support for each version of OpenJDK also varies depending on the vendor.

4. Features

While both Oracle JDK and OpenJDK include all the features and components required to develop, run, and debug Java applications, there are some differences in the implementation. Oracle JDK includes some proprietary features that are not available in OpenJDK, such as Java Flight Recorder and Java Mission Control. However, these features are available in OpenJDK if you use a build that includes them.

Which one should you choose?


Choosing between Oracle JDK and OpenJDK depends on your specific needs and requirements. If you require commercial support, then Oracle JDK may be the better choice for you. If you are looking for a free and open-source alternative, then OpenJDK may be the better choice. It is also worth noting that some third-party vendors provide commercial support for OpenJDK, so you may be able to get the support you need without purchasing a license from Oracle.