Profile Image
vishnupriya

What is JVM startup parameter: -XX:MaxInlineSize?

What is JVM startup parameter: -XX:MaxInlineSize? 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-maxinlinesize

  • x-maxinlinesize

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

This flag allows to set a maximum size (in bytes) bytecode of the method to be inlined. Its syntax is: -XX:MaxInlineSize=value, where value is the size to be used in bytes.

 

Since:

 

Starting from JDK 6.

 

Examples:

 

To set a maximum size to 200 bytes:

 

-XX:MaxInlineSize=200

 

Description:

 

There are a lot of JVM JIT compiler optimization techniques, the most important of which is inlining. Method inlining saves the creation of method stack frames, and method inlining also enables more and deeper optimizations by the JIT compiler. JVM introduced some arguments related to inlining, one of them is “MaxInlineSize” which sets the maximum bytecode size of the method that can be inlined, this method does not need to be called frequently. For example: the getter and setter methods in the general POJO class, they are not the kind of methods that are called very frequently, but their bytecode size is very short, and this method will be inlined after execution.

 

You can also specify a data unit such as “k” or “K” for kilobytes, “m” or “M” for Megabytes and “g” or “G” for Gigabytes.

 

  • For using 512 Kilobytes: -XX:MaxInlineSize=512k
  • For using 128 Megabytes: -XX:MaxInlineSize=128m
  • For using 12 Gigabytes: -XX:MaxInlineSize=12g

 

Default Value:

 

By default, the maximum size set is 35 bytes.

 

Arguments related:

 

InlineSmallCode, FreqInlineSize and Inline

 

Related Posts:

 

 

 

Got something else on mind? Post Your Question

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

  • xx-maxinlinesize

  • x-maxinlinesize

  • JVM startup parameter