每个Java应用程序有一个JVM吗? [英] Is there one JVM per Java application?
问题描述
所有运行的Java应用程序使用的JVM是相同的,或者每个Java应用程序一个JVM是否适用? (例如,应用程序是IntelliJ IDEA,服务器和NetBeans)
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)
此外,分配的JVM与每个Java应用程序使用的进程之间是否存在任何连接?
Further, is there any connection between JVMs assigned and processes used by each Java application?
推荐答案
一般来说,每个应用程序都将获得自己的JVM实例和自己的操作系统级进程,并且每个JVM实例都是相互独立的。
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.
有一些实现细节,例如类数据共享,其中多个JVM实例可能共享一些数据/内存,但那些对应用程序没有用户可见的影响(除了改善的启动时间,希望然而,
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).
然而,常见的情况是单个应用程序服务器(或Web服务器),例如运行多个Web应用程序的Glassfish或Tomcat。在这种情况下,多个Web应用程序可以共享JVM。
A common scenario however is 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.
这篇关于每个Java应用程序有一个JVM吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!