Is there one JVM per Java application?

前端 未结 8 1641
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 18:52

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 exa

8条回答
  •  星月不相逢
    2020-11-28 19:18

    In theory you can run multiple applications in a JVM. In practice, they can interfere with each other in various ways. For example:

    • The JVM has one set of System.in/out/err, one default encoding, one default locale, one set of system properties, and so on. If one application changes these, it affects all applications.
    • Any application that calls System.exit() kills all applications.
    • If one application thread goes wild, and consumes too much CPU or memory it will affect the other applications too.

提交回复
热议问题