Profile Image
vishnupriya

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

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

  • x-useshm

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

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 “UseSHMenables 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.

 

Got something else on mind? Post Your Question

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

  • xx-useshm

  • x-useshm

  • JVM startup parameter