Heap space out of memory

前端 未结 9 1785
梦如初夏
梦如初夏 2020-11-27 04:33

My application currently consumes quite a lot of memory because it is running physics simulations. The issue is that consistently, at the 51st simulation, Java will throw an

9条回答
  •  盖世英雄少女心
    2020-11-27 05:06

    No. The heap is cleared by the garbage collector whenever it feels like it. You can ask it to run (with System.gc()) but it is not guaranteed to run.

    First try increasing the memory by setting -Xmx256m

提交回复
热议问题