Is it possible to find the PID of this process in UNIX with the help of this object description?
The simple answer is No. There is no way.
Firstly, that "descriptor" is simply the output of the default implementation of toString()
. It consists of the object's class name and its "identity hash code". It does not encode the state of the object.
The identity hashcode is a value that is typically calculated based on the address of the object the first time the method was called. However:
it is a 32bit (max) value and that can't encode a full 64bit address on a 64 bit JVM,
the object may no longer be at the same address it was when the identity hashcode was computed, and
you can't turn a machine address into a Java reference (or vice versa) in pure Java. (And even use of non-pure Java tricks is liable to give you JVM stability problems if you get it wrong.)
However, if you have an object reference for the UnixProcess
object, it should be possible to use reflection to poke around in its private fields and dig out the UNIX pid value.