Is there a way to get the parameters of a running JVM?
Is there a command-line tool, like jstat, which takes as input the PID of the JVM and returns its starting parameters? I am particularly interested in the -Xmx and -Xms values that were given when starting the JVM.
To clarify my constraints for the JVM, we would like to check if it is running on a production server. That's why we prefer the minimum disruption. We are able to monitor the JVM using jstat, and so we hope there's a similar simple solution to access the parameters.
We also tried to get the parameters using jvisualvm. But in order to connect to a remote jvm, we need to run jstatd and modify the security settings of the JVM, which we found to be very disruptive and risky on a production server.
JVM has four types of GC implementations: Serial Garbage Collector. Parallel Garbage Collector. CMS Garbage Collector.
You can change the parameters passed to the JVM in the Arguments tab in the VM Arguments box. That configuration can then be used as the default when running the project.
options configuration file. The default location of this file is config/jvm. options (when installing from the tar or zip distributions) and /etc/elasticsearch/jvm. options (when installing from the Debian or RPM packages).
Description. The java command starts a Java application. It does this by starting the Java Virtual Machine (JVM), loading the specified class, and calling that class's main() method. The method must be declared public and static , it must not return any value, and it must accept a String array as a parameter.
You can use jps like:
jps -lvm
It prints something like:
4050 com.intellij.idea.Main -Xms128m -Xmx512m -XX:MaxPermSize=250m -ea -Xbootclasspath/a:../lib/boot.jar -Djb.restart.code=88 4667 sun.tools.jps.Jps -lvm -Dapplication.home=/opt/java/jdk1.6.0_22 -Xms8m
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With