Max memory for 64bit Java

后端 未结 5 1798
庸人自扰
庸人自扰 2020-12-05 19:09

What\'s the maximum amount of heap space that one can allocate for java on a 64-bit platform? Is it unlimited?

5条回答
  •  温柔的废话
    2020-12-05 19:33

    If you could make every atom in the universe into a byte of RAM, you could allocate it in a 64 bit address space.

    Actually, that's a slight exaggeration.

    There are 10^80 atoms in the universe (according to WolframAlpha), and 2^64 bytes of address space in a 64 bit system, so you'd only be able to address 1 out of every 5x10^60 atoms. But if you have 18 qintillion bytes of RAM, you'd probably need a couple of quantum black holes to power it with.

提交回复
热议问题