Can a JVM PID change?

0

Say I'm running a simple Java application on a linux server and I want to get information about the JVM system properties rather frequently. For this purpose, I was thinking of making an API I could call with the PID of that JVM. The problem is, if the PID changes, I can't guarantee this will work very well.

To further extend this issue, assume the server lives forever, and that I might tinker with various applications of different scale (could be more than one server).

For that reason I was wondering if a JVM PID could change, or would it always be static?

paggers

Posted 2019-08-16T23:50:00.347

Reputation: 1

a PID is persistent across the lifetime of a process. Of course if you restart the server then it can have a different PID. You can't assume the a process lives forever. What if the server restarts or crashes? – phuclv – 2019-08-17T01:37:34.863

No answers