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:
- Why Java's TLABs are so important and why write contention is a performance killer in multicore environments
- Java
Edit your Comment