Profile Image
vishnupriya

What is Java Mixed Interpreted/Compiled Mode: -Xmixed?

What is Java Mixed Interpreted/Compiled Mode: -Xmixed? 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

  • xmixed

  • mixed

  • Java Mixed Interpreted Mode

  • Java Mixed Compiled Mode

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:


• -Xmixed


Description:


The -Xmixed flag enables mixed mode execution, i.e. both interpreted and
compiled. This is the default.


In mixed mode, methods are initially run in interpreted mode. Methods that
are repeatedly invoked may be converted to native code and thereafter run in
compiled mode for better performance.


Applications do not need to specify this flag because it is the default.


Nevertheless the flag can be useful in shell scripts where a Java command line
is generated programmatically. If an earlier part of the script has added either
-Xcomp or -Xint to the command line, then the command can be reverted back
to mixed mode by appending -Xmixed. This works because later arguments on
the command line take precedence.


Default Value:


-Xmixed is on by default.


Errors:


-Xmixed should not be used with either -Xcomp or -Xint because they are
contradictory. However, no error is thrown if two or more of these options are
used. The last parameter on the command line determines the actual mode used.
For example if the following command is run:
java -Xcomp -Xint -Xmixed
then the JVM shall run in mixed mode.


Arguments Related to -Xmixed:


TODO: link to -Xbatch, -Xcomp, -Xint


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

  • xmixed

  • mixed

  • Java Mixed Interpreted Mode

  • Java Mixed Compiled Mode