Java Options and Arguments

In order to ensure cost efficiency, all Apiqcloud-managed Java servers are automatically configured to utilize memory in the most beneficial way by adjusting the main Java memory parameters based on the number of resources, allocated to a container.

 

Tip: Non Apiqcloud-managed Java-based containers can be optimized in a similar way using the Java Memory Agent add-on.

 

Herewith, for a high performance or any other custom configurations, the default options can be manually changed.

 

1. In order to provide all the preferred Java options at once, the variables.conf file can be utilized.

Depending on a particular application server you are working with, the exact location may vary:

  • Tomcat, TomEE - /opt/tomcat/conf/variables.conf
  • Jetty - /opt/jetty/etc/variables.conf
  • Spring Boot - /opt/shared/conf/variables.conf
  • GlassFish - /opt/glassfish/glassfish/domains/domain1/config/variables.conf
  • Payara - /opt/payara/glassfish/domains/domain1/config/variables.conf
  • WildFly - /opt/wildfly/conf/variables.conf

 

 

2. Restart nodes after applying changes.

 

          

 

Redefining Main Java Parameters

The most essential memory parameters (-Xms, -Xmn, -Xmx, -Xminf, -Xmaxf, -XX:MaxPermSize, -XX:+Use.*GC) can be redefined using the dedicated environment variables.

 

Like example, you can Add the -Xmx option (i.e. maximum size for the Java heap memory):

 

      

Spring Boot and Java Engine Specific Variables

When operating with the Spring Boot and Java Engine templates, you can provide two additional variables:

  1. JAVA_OPTS - to customize Java options for your app (similar to the variables.conf file).
  2. JAVA_ARGS - to pass some custom arguments to your application main function.

 

 

Restart your application server(s) in order to apply changes.

  • Java Options and Arguments in apiqcloud
  • 0 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

Secure Java Encryption and Decryption

Secure Java Encryption and Decryption in Apiqcloud Java security technology includes a...

Timezone Data for Java/PHP App Server

  Managing Timezone Data for Java/PHP App Server All of the Java and PHP application servers...

Tomcat HTTP to HTTPS redirect

Option 1 Update web.xml configuration file and add the following content into the...

Environment Variables - Java custom Environment Variables

Environment variables represent a kind of placeholders, where you can store the frequently...

Java App server Configuration

To perform the necessary configurations, press the Config button next to your application...