HPC with Java

Last updated January 13, 2025

There are two main versions of Java: JDK (Java Development Kit), which is provided by Oracle, and OpenJDK, which is an open source implementation of JDK.

While there are differences in licensing, both versions of Java should provide similar behavior. Refer to the documentation of the Java program you are using to determine which one is best.

0.1 Java installations

To see what Java modules are available to load use the module avail command:

$ module avail jdk

0.2 Memory and Heap Management

Scientific applications can easily exceed the 512MB default memory limit Java has in place. If necessary the “heap” size can be increased with the -XmxN option, with N being the desired size in bytes. For example to set a 16GB limit,

java -Xmx16g -jar file.jar

For more information please see the Java documentation: https://docs.oracle.com/en/java/javase/20/docs/specs/man/java.html