Profile Image
vishnupriya

What is Set size of large pages: -XX:+OptimizeStringConcat?

What is Set size of large pages: -XX:+OptimizeStringConcat? 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-optimizestringconcat

  • x-optimizestringconcat

  • Set size of large pages

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

You can tell the JVM to optimize concat operations with the following:

 

-XX:+OptimizeStringConcat

 

Description:

 

This flag allows the JVM to optimize the use of StringBuilder instances – in particular those StringBuilders which are created by the compiler when we use the concat operation like:

 

String concatted = “a “ + “concat”;

 

The javac compiler translates this into a number of append operations on a StringBuilder object. When we enable the OptimizeStringConcat flag, the JIT compiler will optimize the creation of StringBuilder by itself.

 

Default Value:

 

Default is false until 7u4, where it’s enabled by default.

 

Errors:

 

None

 

Arguments related:

 

None

 

Related Posts

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-optimizestringconcat

  • x-optimizestringconcat

  • Set size of large pages