Why do we have to increase the Java Heap?

前端 未结 4 1071
死守一世寂寞
死守一世寂寞 2021-01-19 17:26

I know how to set the Java heap size in Tomcat and Eclipse. My question is why? Was there an arbitrary limit set on the initial heap back when Java was first introduced so

4条回答
  •  孤独总比滥情好
    2021-01-19 17:54

    Even now, the heap doesn't grow without limit.

    When the oldest generation is full, should you expand it or just GC? Or should you only expand it if a GC doesn't free any memory?

    .NET takes the approach you'd like: you can't tell it to only use a certain amount of heap. Sometimes it feels like that's a better idea, but other times it's nice to be able to have two processes on the same machine and know that neither of them will be able to hog the whole of the memory...

提交回复
热议问题