Reference Information. I run some performance tests on a Java application that runs through several levels of indirection, so I'm not quite sure if the application starts with flags that I think are. I want my application to enable a health check (before it starts the performance test) and include in the results (after the test) JVM tuning information, for example:
- Which garbage collector was used?
- Was he actively doing cpu profiling?
- Was / was there gc activity recording?
- Was / is in
-Xint or -Xmixed ? - Was / is
-XX:ParallelGCThreads installed - if so, then what, and if not, what is the default for this assembly? - Enabled or disabled / was
-XX:UseCompressedOops ? - and etc.
Is there any way for Java code (within a running JVM) to query the actual parameters used for its containing JVM? (Suppose I donโt see the command line that launched me, so I canโt see these flags again.)
If there is no universal way to determine this, answers specific to the specific JVM implementation are also welcome.
UPDATE:
It is important that the solution can find out what the default values โโare for any value that is not explicitly specified on the command line. Otherwise, it will use a lot of errors (error prone) to find what the default value for this combination is JVM / platform / version / architecture. I am testing a wide variety of JVMs, so I donโt want to manually determine what the default value is for each parameter in every jvm release.
java jvm jvm-arguments
Mickalot
source share