Engineering team asks for heap dump on a long GC time issue, but the heap dump fails sometimes with error,
744265: Unable to open socket file: target process not responding or HotSpot VM not loaded
The -F option can be used when the target process is not responding
smps version : Version: 12.8; Update: 08.00; Build: 2892; CR: 00;
OS: Red Hat Enterprise Linux release 8.9 (Ootpa) x86_64
java version "1.8.0_401"
The smpolicysrv is not really a java application, it's actually a c++ application -- from the smps.log, you can see a lot of .CPP objects.
But it also has a JNI layer -- it will init a jvm thread when needed. i.e. it does not always have the JVM (the Java code handles Federation code and Custom Active expressions/ schemes, etc.)
If the JVM is not init, and you try to do heap dump on it, the smpolicysrv will crash and smexec will restart the smpolicysrv.
The trace log has the details when and how the JVM is initialized.
Steps for heap dump,
ps aux|grep smpolicysrv|grep -v grep|awk '{print $2}'
jps -v|grep <pid of smpolicysrv>
If the jvm on <pid of smpolicysrv> is not found, stop here, we cannot make heap dump or thread dump, otherwise smpolicysrv will crash.
jmap -dump:live,format=b,file=heapsm.hprof <pid of smpolicysrv>
jstack <pid of smpolicysrv> > thread.tdump