A simple “Hello World” needs 10G virtual memory on a 64-bit machine vs 1G at 32-bit?

前端 未结 7 1388
有刺的猬
有刺的猬 2021-02-02 05:33

Running a simple Java program on our production machine, I noticed that this program eats up more 10G virt. I know that virtual memory is not that relevant, but at least I would

7条回答
  •  长发绾君心
    2021-02-02 05:50

    Imagine you're in the document storage business. You have a small facility in the middle of the city that stores boxes of papers, and a much larger warehouse outside of town with 1000 times the space. Every box has a label on it identifying its contents.

    The in-city facility is main memory. The warehouse is disk space.

    A 10GB virtual memory allocation for a new process doesn't mean finding room for 10 billion boxes for a new customer. It means printing 10 billion labels for boxes with contiguous ID numbers on them.

提交回复
热议问题