I have reviewed the answer to how to get the min and max heap size settings of a JVM from within a Java program which was helpful, but the accepted answer doesn’t appear to answer half of the question. In essence, I want to report the -Xms and -Xmx settings that were used when the JVM was launched.
Share
If you want to get the real JVM arguments this should help you. You can get all JVM arguments with the MXBean:
You have to look for the arguments which start with “-Xm(s|x)”. The problem is that the value could be something like “256M”.