How do I start a JVM with unlimited memory?

前端 未结 1 1519
借酒劲吻你
借酒劲吻你 2021-02-09 11:37

How do I start a JVM with no heap max memory restriction? So that it can take as much memory as it can ?

I searched if there is such an option, but I only seem to find t

相关标签:
1条回答
  • 2021-02-09 11:58

    You can't (or at least, I don't know a JVM implementation that supports it). The JVM needs to know at start up how much memory it can allocate, to ensure that it can reserve a contiguous range in virtual memory. This allows - among others - for simpler reasoning in memory management.

    If virtual memory would be expanded at runtime, this could lead to fragmented virtual memory ranges, making tracking and referencing memory harder.

    0 讨论(0)
提交回复
热议问题