Profile Image
vishnupriya

What is Unlock Diagnostic VM Options: -XX:+UnlockDiagnosticVMOptions?

What is Unlock Diagnostic VM Options: -XX:+UnlockDiagnosticVMOptions? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvm-argument

  • xx-unlockdiagnosticvmoptions

  • x-unlockdiagnosticvmoptions

  • Unlock Diagnostic VM Options

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:
• -XX:+UnlockDiagnosticVMOptions


Description:


The -XX:+UnlockDiagnosticVMOptions flag unlocks additional options for diagnosing faults or performance problems with the JVM.
The flags that require unlocking with -XX:+UnlockDiagnosticVMOptions are
as follows:

 

• -XX:CompilerDirectivesFile
• -XX:+CompilerDirectivesPrint
• -XX:+LogCompilation
• -XX:+PrintAssembly
• -XX:+PrintInlining
• -XX:+UseAES
• -XX:+UseAESIntrinsics
• -XX:+UseAESCTRIntrinsics
• -XX:+UseGHASHIntrinsics
• -XX:+UseBASE64Intrinsics
• -XX:+UseAdler32Intrinsics
• -XX:+UseCRC32Intrinsics
• -XX:+UseCRC32CIntrinsics
• -XX:+UseSHA
• -XX:+UseSHA1Intrinsics
• -XX:+UseSHA256Intrinsics
• -XX:+UseSHA512Intrinsics
• -XX:+UseMathExactIntrinsics
• -XX:+UseMultiplyToLenIntrinsic
• -XX:+UseSquareToLenIntrinsic
• -XX:+UseMulAddIntrinsic
• -XX:+UseMontgomeryMultiplyIntrinsic
• -XX:+UseMontgomerySquareIntrinsic


These flags should not be enabled as a matter of course in a production system,
but should only by used when attempting to diagnose a bug or performance issue.

 

Default Value:


-XX:+UnlockDiagnosticVMOptions is off by default, i..e the diagnostic options
are not unavailable.

Errors:


Example of using a flag that requires -XX:+UnlockDiagnosticVMOptions but
without supplying that flag:


java -XX:+CompilerDirectivesPrint


The output of the above command is:


Error: VM option 'CompilerDirectivesPrint' is diagnostic and must
be enabled via -XX:+UnlockDiagnosticVMOptions.
Error: The unlock option must precede 'CompilerDirectivesPrint'.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

 

Arguments Related to -XX:+UnlockDiagnosticVMOptions


TODO: link to all of the following flags:


• -XX:CompilerDirectivesFile-
• -XX:+CompilerDirectivesPrint
• -XX:+LogCompilation
• -XX:+PrintAssembly
• -XX:+PrintInlining
• -XX:+UseAES
• -XX:+UseAESIntrinsics
• -XX:+UseAESCTRIntrinsics
• -XX:+UseGHASHIntrinsics
• -XX:+UseBASE64Intrinsics
• -XX:+UseAdler32Intrinsics
• -XX:+UseCRC32Intrinsics
• -XX:+UseCRC32CIntrinsics
• -XX:+UseSHA
• -XX:+UseSHA1Intrinsics
• -XX:+UseSHA256Intrinsics
• -XX:+UseSHA512Intrinsics
• -XX:+UseMathExactIntrinsics
• -XX:+UseMultiplyToLenIntrinsic
• -XX:+UseSquareToLenIntrinsic
• -XX:+UseMulAddIntrinsic
• -XX:+UseMontgomeryMultiplyIntrinsic
• -XX:+UseMontgomerySquareIntrinsic

 

Related Posts:


None

NOTE:


If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your
insights will help the entire 10+ million java developer community to develop
one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm-argument

  • xx-unlockdiagnosticvmoptions

  • x-unlockdiagnosticvmoptions

  • Unlock Diagnostic VM Options