ASD
ASD

Reputation: 335

JVM and Java Process

This might be a very basic query about Java JVM. If I've brought up 2 separate programs using a bash script, 2 processes are running and I can see the processes using ps -ef command.

Does that mean they are running as 2 separate JVM's? I have this query, since I can see that the parent process id (PPID) is same for both the processes.

Upvotes: 3

Views: 649

Answers (2)

Juraj Martinka
Juraj Martinka

Reputation: 4366

Yes, both are two completely separate JVMs running as native OS processes. This includes garbage collector, JIT compiler, and all the other usual stuff.

Each OS process has a parent, if nothing else, then it's the "init" process that starts as the first thing when the OS is booting.

Btw. Java command line tools, notably jcmd are really good for exploring java/jvm processes on your machine - e.g. you can just type jcmd to list all of them; type jcmd <PID> help to check list of available commands for specific process.

htop is another good tool to explore process hierarchy.

Upvotes: 1

a guest
a guest

Reputation: 472

Does that mean they are running as 2 separate JVM's?

Yes. The 'java' command starts a JVM.

Upvotes: 4

Related Questions