Increase heap size in Java

后端 未结 12 2284
情深已故
情深已故 2020-11-21 05:26

I am working on a Windows 2003 server (64-bit) with 8 GB RAM. How can I increase the heap memory maximum? I am using the -Xmx1500m flag to increase the heap siz

12条回答
  •  悲哀的现实
    2020-11-21 05:58

    It is possible to increase heap size allocated by the JVM by using command line options Here we have 3 options

    -Xms        set initial Java heap size
    -Xmx        set maximum Java heap size
    -Xss        set java thread stack size
    
    java -Xms16m -Xmx64m ClassName
    

    In the above line we can set minimum heap to 16mb and maximum heap 64mb

提交回复
热议问题