1

Several sources show how JVM arguments such as -Xmx can be set in the app.yaml entryPoint command:

https://cloud.google.com/appengine/docs/standard/java11/building-app/writing-web-service https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/appengine-java11/kotlin-ktor/app.yaml

However I don't see any documentation about the recommended settings or if it is required for good performance. What settings are used if we do not specify memory values? Do the memory settings adjust automatically as the machine type changes?

Naman
  • 23,555
  • 22
  • 173
  • 290
Dev Vercer
  • 116
  • 6

1 Answers1

3

There are no universal "recommended" arguments / settings. Settings that may be good for one application or use-case can be terrible for another one.

As a general rule, no JVM settings at all is good starting point. Then you observe, measure, tune, repeat until performance is acceptable. (Or don't bother.)

What settings are used if we do not specify memory values? Do the memory settings adjust automatically as the machine type changes?

The default heap size values depend on the Java version and the platform. For recent Oracle / OpenJDK versions, the default max heap size is 1/4 of physical RAM and the default initial heap size is 1/64th of physical RAM; see

You can also use the -XX:+PrintFlagsFinal option to print the values of all JVM settings.

Stephen C
  • 632,615
  • 86
  • 730
  • 1,096