Is there one JVM per Java application?

前端 未结 8 1623
被撕碎了的回忆
被撕碎了的回忆 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:12

    Actually this is one question that can have very confusing answers. To keep it real short:

    1. Yes per java process, per JVM.
    2. Runtime and ProcessBuilder follow this rule.
    3. Loading jars using reflection and then executing the main won't spawn new JVM.

提交回复
热议问题