I ran into a problem that is very similar to other SO question ( jps returns no output even when java processes are running ). Before I read that question I though that my problem is that jstatd is not running, but solution in that question implies that jps uses some sort of temporary files. I also realized that it is possible to monitor local JVMs without any network activity at all and I’m curious how does it work. I’m not asking for a solution to my problem, I just want to know how jps and others work locally. It surprises me that I don’t know it at all after so many years spent in Java development.
Share
In case of local usage the default implementation of MonitoredHost is sun.jvmstat.perfdata.monitor.protocol.local.MonitoredHostProvider which uses sun.jvmstat.perfdata.monitor.protocol.local.LocalVmManager. It’s method activeVms(), wher the real work is being done, loops through files in user temp directories searching for files with known filename format where started JVMs publish their monitoring data. No TCP at all as I suspected. Interesting.