Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused about Java Memory [duplicate]

Tags:

java

process

jvm

Is the same JVM used by all Java applications running or, does 'one JVM per Java application' apply? (say the applications are IntelliJ IDEA, a server and NetBeans for example)

Further, is there any connection between JVMs assigned and processes used by each Java application?

like image 356
nadh Avatar asked May 07 '26 09:05

nadh


1 Answers

Generally speaking, each application will get its own JVM instance and its own OS-level process and each JVM instance is independent of each other.

There are some implementation details such as Class Data Sharing, where multiple JVM instances might share some data/memory but those have no user-visible effect to the applications (except for improved startup time, hopefully).

A common scenario however used to be a single application server (or "web server") such as Glassfish or Tomcat running multiple web applications. In this case, multiple web applications can share a JVM. With the move towards containerization and microservices this setup has become somewhat less common, though.

like image 135
Joachim Sauer Avatar answered May 09 '26 21:05

Joachim Sauer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!