Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is lvmid in java?

Tags:

java

I'm learning how to use jps, and I find this page: jps. It says that:

The lvmid is typically, but not necessarily, the operating system's process identifier for the JVM process.

So I'm wondering in what situation jps is not the operating system's process identifier?

Anyone would help?

like image 993
khotyn Avatar asked Dec 07 '10 09:12

khotyn


People also ask

What is JPS command?

The jps command uses the Java launcher to find the class name and arguments passed to the main method. If the target JVM is started with a custom launcher, then the class or JAR file name, and the arguments to the main method aren't available.

How do I check if JVM is running on Linux?

You can run the jps command (from the bin folder of JDK if it is not in your path) to find out what java processes (JVMs) are running on your machine.

How do I cancel my JPS?

ie: kill jps|grep "Server" | cut -d " " -f 1 , there are multiple server processes running and this command does kills all the processes but it takes a while.


2 Answers

Do all operating systems have the notion of a "process ID"? Maybe not. Some of them may even represent process IDs, not as Integers, but in an entirely different form. Process IDs are a platform specific concept and could change in the future. Java is designed to be platform-independent. This is why it may not always work.

However, on all major operating systems currently in use today, the lvmid should always return the operating system's process ID for the JVM process.

like image 181
dogbane Avatar answered Sep 24 '22 03:09

dogbane


It's basically saying that the lvmid is typically the same as the O/S pid (process id), but that it doesn't have to be the same. Some operating systems might differentiate between them (I don't know which ones).

like image 33
Martijn Verburg Avatar answered Sep 23 '22 03:09

Martijn Verburg