Increase heap size in Java

后端 未结 12 2258
情深已故
情深已故 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 06:09

    Yes. You Can.

    You can increase your heap memory to 75% of physical memory (6 GB Heap) or higher.

    Since You are using 64bit you can increase your heap size to your desired amount. In Case you are using 32bit it is limited to 4GB.

    $ java -Xms512m -Xmx6144m JavaApplication
    

    Sets you with initial heap size to 512mb and maximum heapsize to 6GB.

    Hope it Helps.. :)

提交回复
热议问题