Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do 2 java processes share JVM

Say I run 2 java processes in a machine, do they share JVM or they have their own separate JVM. I remember setting something like export JVM_OPTS="-Xms64m -Xmx1024m"

then which JVM is this for?

like image 673
xyz Avatar asked Sep 07 '25 04:09

xyz


1 Answers

They have their own separate JVM.
If you export JVM_OPTS, the variable affects all JVMs reading that value.
If you want to share JVM among different computations you must use multithreading.

like image 72
Andrea Colleoni Avatar answered Sep 10 '25 00:09

Andrea Colleoni