Why have one JVM per application?

前端 未结 5 1035
长情又很酷
长情又很酷 2020-11-30 02:57

I read that each application runs in its own JVM. Why is it so ? Why don\'t they make one JVM run 2 or more apps ?

I read a SO post, but could not get the answers th

5条回答
  •  忘掉有多难
    2020-11-30 03:22

    For isolating execution contexts.

    If one of the processes hangs, or fails, or it's security is compromised, the others don't get affected.

    I think having separate runtimes also helps GC, because it has less references to handle than if it was altogether.

    Besides, why would you run them all in one JVM?

提交回复
热议问题