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.
Asked
Active
Viewed 903 times
0
-
You'll probably get better help if you describe your problem in this post. Then you can add the link to the other question and explain why that doesn't work for you. – S.L. Barth is on codidact.com Oct 26 '11 at 12:58
-
I don't want to be rude, but your comment doesn't make sense if you consider the sentence: "I'm not asking for a solution to my problem, I just want to know how jps and others work locally." – calavera.info Oct 26 '11 at 13:25
-
I believe the jps uses TCP sockets across the loopback adapter just like other JMX commands. Could this be a firewall issue on your box? – Gray Oct 26 '11 at 21:56
-
It's the point of this question - I suspect jps doesn't use TCP. And I was right, see my answer... – calavera.info Oct 27 '11 at 12:07
1 Answers
1
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.

calavera.info
- 1,170
- 2
- 15
- 30