Unofficial Content

The J2SE Development Kit (JDK) provides two flavors of the Java virtual machine (VM) which is called ergonomics and its objective is to provide good performance with little or no tuning of command line options by selecting the garbage collector, heap size and runtime compiler:

  • Java HotSpot Client VM (client VM); is tuned for best performance when running applications in a client environment by reducing application start-up time and memory footprint. It can be invoked by using the -client command-line option when launching an application. The following configuration is assigned by default:
    • Garbage Collector: Serial collector
    • Initial heap: 4 MB (-Xms Command-line option)
    • Maximum heap: 64 MB(-Xmx Command-line option)
  • Java HotSpot Server VM (server VM); is designed for maximum program execution speed for applications running in a server environment (2 CPUs or More and 2 GB or more). It can be invoked by using the -server command-line option when launching an application. It uses:
    • Garbage Collector: Parallel Garbage collector.
    • Initial heap: 1/64 Physical Memory up to 1GB.
    • Maximum heap: 1/4 Physical Memory up to 1GB.

When no –client or –server options are used, the VM will attempt to detect whether the application is running on a Server-Class machine. Based upon the platform configuration, it will select a compiler, Java heap configuration, and garbage collector that produce good to excellent performance for most applications.

Related link: The Java HotSpotTM Server VM

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant