Profile Image
vishnupriya

What is JVM runtime tuning: -XX:ActiveProcessorCount?

What is JVM runtime tuning: -XX:ActiveProcessorCount? 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-activeprocessorcount

  • x-activeprocessorcount

  • JVM runtime tuning

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:                                                    

 

You can override the number of CPUs that JVM will use:

 

-XX:ActiveProcessorCount=x, where x is the desired amount of CPU’s that you want JVM to use.

 

Examples:

 

To limit the amount of CPUs available to 1 use the following:

 

-XX:ActiveProcessorCount=1

 

Description:

 

Some java options allows us to change control of the runtime behavior of the Java HotSpot VM. The ActiveProcessorCount will override the number of CPUs that the VM will detect and use to calculate the size of thread pools it will use for various operations such as Garbage Collection and ForkJoinPool. The VM normally determines the number of available processors from the operating system. This flag can be useful for partitioning CPU resources when running multiple Java processes in docker containers. This flag is honored even if UseContainerSupport is not enabled.

 

Default Value:

 

The default size depends on is provided by the environment to JVM.

 

Errors:

 

The value should be greater than 0

 

Arguments related:

 

TODO link UseContainerSupport

 

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

  • x-activeprocessorcount

  • JVM runtime tuning