Profile Image
vishnupriya

What is JVM startup parameter: -XX:[+|-]UseTLAB?

What is JVM startup parameter: -XX:[+|-]UseTLAB? 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-usetlab

  • x-usetlab

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:                                                    

 

The option “UseTLAB” enables the use of thread-local allocation blocks (TLABs) in the young generation space.

 

Since:

 

Starting from JDK 6.

 

Syntax:

 

java -XX:[+|-]UseTLAB MainClass

 

Examples:

  • To enable the use of thread-local allocation blocks: java -XX:+UseTLAB MainClass
  • To disable the use of thread-local allocation blocks: java -XX:-UseTLAB MainClass

Description:

 

This option enables the JVM to use thread-local object allocation blocks. This improves concurrency by reducing contention on the shared heap lock. The thread local object allocation blocks, which is a piece of private memory for threads. If the virtual machine parameter -XX:+UseTLAB is set, at the time of thread initialization, a memory block of the specified size will also be requested for use only by the current thread, so that each thread has a separate Buffer and if memory needs to be allocated, it will be on its own allocate on Buffer so that there is no competition and the allocation efficiency can be greatly improved. When the Buffer capacity is insufficient, re-apply a piece from Eden area to continue to use. This application action still requires atomic operation. Its technical core is to improve memory allocation by reducing a large number of atomic operations.

 

Default Value:

 

This option is enabled by default.

 

Errors:

 

None.

 

Related Posts:

 

Got something else on mind? Post Your Question

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

  • xx-usetlab

  • x-usetlab

  • JVM startup parameter