Usage:
The option “UseSHM” enables/disables the JVM to use shared memory to setup large pages.
Since:
Starting from JDK 6.
Deprecated:
- Obsoleted in JDK12.
- Expired in JDK13.
Syntax:
java -XX:[+|-]UseSHM MainClass
Examples:
- To enable JVM to use shared memory: java -XX:+UseSHM MainClass
- To disable JVM to use shared memory: java -XX:-UseSHM MainClass
Description:
Before talking about the parameter “UseSHM”, we should start off with a brief introduction to what shared memory and large pages are:
Shared memory is a memory by which can be accessed by multiple programs simultaneously with the intent to exchange data in a fast way and provide a communication between them. When using multithreading, the memory for communication between multiple threads is referred to as shared memory.
Large pages, also known as huge pages, is a technique primarily to improve and provide performance to the application by reducing the pressure on the processors TLB (Translation Lookaside Buffer) cache. These caches are used to speed up the time to translate virtual addresses to physical memory addresses.
Thus, the option “UseSHM” enables or disables the JVM to use shared memory (SHM) to set up large pages only under Linux operating environment.
Default Value:
By default, the option is disabled.
Errors:
None.
Related Posts:
Note:
This option only works on Linux.
Edit your Comment