corretto / corretto-8

Amazon Corretto 8 is a no-cost, multi-platform, production-ready distribution of OpenJDK 8
GNU General Public License v2.0
2.11k stars 221 forks source link

VM options documentation #441

Closed aiasmartakis closed 1 year ago

aiasmartakis commented 1 year ago

Some documentation on the supported VM options or a confirmation that the same options are supported as the OpenJDK versions would be useful. For example do these flags still work? -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dumps/oom.bin

benty-amzn commented 1 year ago

Generally, you can expect Corretto to share its command line options with OpenJDK. See the FAQ, specifically

Q: Can I use Corretto as a drop-in replacement for other JDKs?

A: Corretto is designed as a drop-in replacement for all Java SE distributions unless you are using features not available in OpenJDK. Once Corretto binaries are installed on a host and correctly invoked to run your Java applications (e.g., using the alternatives command on Linux), existing command-line options, tuning parameters, monitoring, and anything else in place will continue to work as before.

If you want to confirm whether a specific flag is available, you can check using a tool like VM Options Explorer

ysramakrishna commented 1 year ago

@aiasmartakis : One easy way to see if an option flag is supported by a version of a JDK release is to just check in the following manner:

$ java <flag> -XX:+PrintFlagsFinal -version | grep <flag>

Checking for your example of flags = -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dumps/oom.bin should likely reveal that it's supported by Corretto 8, although I haven't checked; you should see something like:

     bool HeapDumpOnOutOfMemoryError               = true                                   {manageable} {command line}
    ccstr HeapDumpPath                             = /dumps/oom.bin                         {manageable} {command line}

Cheers!