Profile Image
vishnupriya

What is JVM startup parameter: -XX:+PrintAssembly?

What is JVM startup parameter: -XX:+PrintAssembly? Have you used this JVM arguement before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvmargument

  • xx-printassembly

  • x-printassembly

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

Enables printing of assembly code for byte coded and native methods.

 

Since:

 

Starting from JDK 6.

 

Examples:

 

This will instruct JVM to enable printing of assembly code:

 

-XX:+PrintAssembly

 

Description:

 

The flag is a diagnostic flag for the hotspot JVM that allows us to obtain the JIT compiler/or assembly instructions generated during the interpretation process, which can often be used to help us find problems by analyzing the execution of assembly instructions, or to help us analyze and understand the JVM How it is interpreted and compiled.

 

Enables printing of assembly code for byte coded and native methods by using the external hsdis-<arch>.so or .dll library. For 64-bit VM on Windows, it’s hsdis-amd64.dll. This lets you to see the generated code, which may help you to diagnose performance issues.

 

By default, this option is disabled and assembly code isn’t printed. The -XX:+PrintAssembly option has to be used together with the -XX:UnlockDiagnosticVMOptions option that unlocks diagnostic JVM options.

 

Here is a snippet of the logs displayed when using both flags “-XX:UnlockDiagnosticVMOptions  -XX:+PrintAssembly”

If you want to know more about this output and understand it, we recommend you to visit this link PrintAssembly output explained!

 

Default Value          

 

By default, this option is disabled and assembly code isn’t printed.

 

Arguments related:

 

UnlockDiagnosticVMOptions, PrintNMethods, PrintNativeNMethods, PrintSignatureHandlers, PrintAdapterHandlers, PrintStubCode and PrintInterpreter  

 

Related Posts:

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvmargument

  • xx-printassembly

  • x-printassembly

  • JVM startup parameter