Right now I’m using the application plugin with the following to set JVM args:
applicationDefaultJvmArgs = ['-XX:MaxRAMPercentage=75.0']
The obvious problem with this approach is that the JVM args are fixed once the app is built. How do I pass JVM args dynamically after the app is built?
If you look at the generated start scripts, there are two environment variables that are considered.
<your application>_OPTS. Both can be used to supply additional JVM parameters at runtime.
You can also rename
<applicationName>_OPTS by setting the
optsEnvironmentVar property of the
optsEnvironmentVar = 'MY_OPTS_ENV_VAR'