Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

java - 增加Java中的堆大小(Increase heap size in Java)

I am working on a Windows 2003 server (64-bit) with 8 GB RAM.

(我正在使用具有8 GB RAM的Windows 2003服务器(64位)。)

How can I increase the heap memory maximum?

(如何增加堆内存的最大值?)

I am using the -Xmx1500m flag to increase the heap size to 1500 Mb.

(我正在使用-Xmx1500m标志将堆大小增加到1500 Mb。)

Can I increase the heap memory to 75% of physical memory (6 GB Heap)?

(是否可以将堆内存增加到物理内存(6 GB堆)的75%?)

  ask by Sunil translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can increase to 4GB on a 32 bit system.

(您可以在32位系统上增加到4GB。)

If you're on a 64 bit system you can go higher.

(如果您使用的是64位系统,则可以更高。)

No need to worry if you've chosen incorrectly, if you ask for 5g on a 32 bit system java will complain about an invalid value and quit.

(如果您选择不正确,无需担心,如果您在32位系统上要求5g,则Java会抱怨值无效并退出。)

As others have posted, use the cmd-line flags - eg

(正如其他人发布的那样,使用cmd-line标志-例如)

java -Xmx6g myprogram

You can get a full list (or a nearly full list, anyway) by typing java -X.

(您可以通过键入java -X来获得完整列表(或者无论如何都接近完整列表)。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...