1

現在、SL4 クラスターで Sun の Java 1.6 を使用しています。

何らかの理由で、1.6 JVM が信じられないほど大きなヒープで起動し、起動できません。

java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

たとえば -Xmx1800M で開始すると、問題なく動作します。それで、デフォルトのヒープサイズがどこに設定されているのか、さらに重要なことに、それを変更する方法は?

マシンには 8GB の物理メモリがあり、sun のサーバー JVM はデフォルトで最大 512M のメモリの半分で開始されるはずですが、1800M を超えて割り当てようとしているため、明らかにそうではありません。

編集: _JAVA_OPTIONS を使用できることはわかっていますが、これは少しぎこちなく感じます。プロパティ ファイルがどこかにあると思っていましたが、今のところ見つかりません。

4

2 に答える 2

1

There is no properties file for this. According to Garbage Collector Ergonomics:

initial heap size:

Larger of 1/64th of the machine's physical memory on the machine or some reasonable minimum. Before J2SE 5.0, the default initial heap size was a reasonable minimum, which varies by platform. You can override this default using the -Xms command-line option.

maximum heap size:

Smaller of 1/4th of the physical memory or 1GB. Before J2SE 5.0, the default maximum heap size was 64MB. You can override this default using the -Xmx command-line option.


Note: The boundaries and fractions given for the heap size are correct for J2SE 5.0. They are likely to be different in subsequent releases as computers get more powerful.

Given you have 8GB of RAM, default maximum heap size should be 1GB assuming you're using Java 6.

于 2009-10-30T11:32:55.127 に答える
1

There's no standard properties file. The (Sun) JVM has the default values hardcoded in it.

于 2009-10-30T11:33:30.927 に答える