java - How does JPS tool get the name of the main class or jar it is executing -
I'm wondering, how does the GPS device get the name of the main square executed within the JVM process?
is jps -l 123 package. Main class 456 / path / explorer.jar
I'm talking specifically about Linux (I'm not interested in Windows), and I have no time to experiment Win machine is not.)
I can think of 2 ways
- Connecting to JVM in question which in turn says
-
/ proc
from the file system
About the first option, whether it is using the local JMX connection Is it c? However, it should go to / proc
for pids.
- PID, so it should also ask the OS
-
jps < / Li>
-or
ormain class
-
/ proc
knows about PID well - before
jp
start some things It has its own folder in/ proc
but , I am facing less problem here. When the Java command is too long (as is the longest -classpath
parameter), the information about the command line is not fit in jps
is still able to get that main square somewhere else.
I need to find a fast way to get JVM process compared to calling jps . When the system is full (like when the number of JVM starts) jps
got stuck for several seconds (I've waited it for ~ 30).
jps
via scan / tmp / hsperfdata_ & lt ; Username & gt; / & Lt; Pid & gt;
The files in which Monitor and JVM running counter are the string that you are looking for in the monitor named "Code> sun.rt.javaCommand .
To know the format of the PerfData file, you have to see.
Comments
Post a Comment