Share via


Frequently asked questions about the Azure Command Launcher for Java (public preview)

Provides answers to common questions about the Azure Command Launcher for Java.

How is jaz different from the java command?

The java command runs the HotSpot JVM (Java Virtual Machine) with default settings unless explicitly configured by the user. jaz is a component of the Azure Command Launcher for Java that launches java with battle-tested, cloud-optimized JVM tuning defaults, designed to improve performance and cost-efficiency on Azure VMs and containers.

Key benefit: developers don't need to manually tune the JVM. jaz does it for them.

What happens if I already set some JVM options in my environment?

If your workload includes JVM tuning flags, the jaz command doesn't apply its own tuning defaults. jaz launches java with the flags you chose.

We recommend removing your workload's tuning flags and letting the Azure Command Launcher for Java apply its own.

You can also configure jaz to ignore your tuning flags and use its tuning defaults. Consider using this configuration to validate jaz with minimal change to your workload configuration. To do so, set the following environment variable:

export JAZ_IGNORE_USER_TUNING=1

The ignore user tuning setting applies to command line arguments, environment variables read by java, and @-files.

You can also configure jaz to skip all of its tuning defaults by setting the following environment variable:

export JAZ_BYPASS=1

The bypass option allows you to onboard to the Azure Command Launcher for Java without affecting your current tuning, even if your workload uses the default behavior of the java command. This behavior may be useful to validate the tool's behavior before cleaning up JVM tuning flags.

It may also be useful to bypass tuning when troubleshooting an issue that appears to be related to JVM tuning.

What JVM options are considered tuning flags?

The jaz command considers most flags that start with -X or -XX to be a tuning flag, such as -Xmx<size>. A notable example of a flag that starts with -X but isn't a tuning flag is -Xlog:<opts>.

More precisely, each JVM option is evaluated using the logic in the following list. This list describes the logic in the most recent version of the Azure Command Launcher for Java.

  1. If the option starts with any text other than -X, it's not a tuning flag.
  2. If the option matches any of these regular expressions, it's not a tuning flag:
    • ^-Xlog.+$
    • ^-XX:ErrorFile=.*$
    • ^-XX:[+-]?HeapDump.*$
    • ^-XX:[+-].*OnOutOfMemoryError$
  3. Otherwise, the option is a tuning flag.

When jaz looks for tuning flags, it examines the arguments passed to it and the environment variables that java reads automatically. The environment variables are:

  • Java 8: JAVA_TOOL_OPTIONS, _JAVA_OPTIONS
  • Java 9 and later: JAVA_TOOL_OPTIONS, JDK_JAVA_OPTIONS, _JAVA_OPTIONS

jaz also handles @-files, also known as command line argument files.

Can I pass java agent flags when using jaz?

Yes. You can still pass -javaagent and other flags that aren't tuning flags, and jaz honors them. You can keep useful diagnostic flags such as:

  • -Xlog for logging
  • -javaagent for Application Insights or other Application Performance Monitoring (APM) instrumentation agents

Is jaz compatible with non-Azure environments?

jaz is designed and tested primarily for Azure Containers and Virtual Machines, but it can technically run elsewhere. However, some advanced optimizations and future features might be Azure-specific.

Is jaz available for Windows Server?

jaz is currently available for Linux on x64 and arm64 environments. If you have an immediate need for Windows Server, please contact us at openjdk-support@microsoft.com