Do all operating systems have the concept of a process identifier? Probably no. Some of them may even represent process identifiers, not as whole, but in a completely different form. Process identifiers are a platform concept and may change in the future. Java is designed to be platform independent. That is why this may not always work.
However, in all major operating systems that are currently in use today, lvmid must always return the operating system process identifier for the JVM process.
dogbane
source share