giltene / jHiccup

jHiccup is a non-intrusive instrumentation tool that logs and records platform "hiccups" - including the JVM stalls that often happen when Java applications are executed and/or any OS or hardware platform noise that may cause the running application to not be continuously runnable.
Other
677 stars 92 forks source link

How to use jHiccup with Solr? #31

Open vaomaohaoone opened 6 years ago

vaomaohaoone commented 6 years ago

I've tried use Solr with Jhiccup to analyze garbage collectors of Azul zing JVM and G1GC of Java-Hotspot. I launched solr, and want include jHiccup on it. of solr process is 1078. I used following command: ./jHiccup -l /tmp/jHiccup-2.0.9/hiccup.%date.%pid -p 1078. It should be work, but an error is displayed : A JNI error has occured, please check your installation and try again. Help me please!

giltene commented 6 years ago

attaching on the fly is "flakey" in the sense that it depends on the JDK of both the target process and the one you use to launch the attach. When both are regularly installed JDKs of the same version, things seem to work well, but there are many ways for it to break. The most reliable way to use jHiccup is to add it with the -javaagent (see "Using jHiccup as a Java agent" in thge README) to the launching command line. For exmaples of how to add a javaagent to solr, you can do something similar to what others do e,g. https://docs.newrelic.com/docs/agents/java-agent/installation/include-java-agent-jvm-argument#Installing_on_solr

vaomaohaoone commented 6 years ago

I tried to install jHiccup as a javaagent, adding the following commands to the variable SOLR_OPTS in script solr.in.sh, but it doesn't works: -javaagent:/home/jHiccup-2.0.9/jHiccup.jar="-d 0 -i 1000 -l hicc -c". Because for me this method does not create output files from jHiccup. Any ideas?)

giltene commented 6 years ago

Can you please get the full solr command line from ps -ef | grep java and paste it here?

vaomaohaoone commented 6 years ago

Unfortunately no, I will return my workstation only in the middle of August, but I will try to perform the same operations on my laptop in some of these days