简体   繁体   English

Java Java内存分配

[英]java jvm memory assignment

I have a program that is very memory consuming and thought to assign more maximum memory to the java jvm using -Xmx2048m. 我有一个程序非常消耗内存,并考虑使用-Xmx2048m为Java jvm分配更多的最大内存。 But when starting I get a 'Could not reserve enough space for object heap' error. 但是启动时,出现“无法为对象堆保留足够的空间”错误。

When trying several values and found out that my greatest value is -Xmx1560m and it starts. 当尝试多个值时,发现我的最大价值是-Xmx1560m并开始。 But I like to assign 2GB. 但是我喜欢分配2GB。 I have 6GB physical Memory and Taskmanager shows 3400MB available after I started the java-process with -Xmx1560m. 我使用-Xmx1560m启动Java进程后,我具有6GB的物理内存,并且Taskmanager显示3400MB可用。

Do anyone know why I can't assign 2GB ? 有谁知道为什么我不能分配2GB?

32-bit windows limits programs to around 1.2 - 1.5 GB of continuous memory. 32位Windows将程序限制为大约1.2-1.5 GB的连续内存。 This limit applies even if you have a 64-bit OS but you are emulating a 32-bit environment for a 32-bit JVM. 即使您具有64位操作系统,但您正在为32位JVM模拟32位环境,此限制也适用。

The way to avoid this limit is to use a 64-bit OS and a 64-bit JVM and the limit is much higher depending on the flavour of Windows you have bought. 避免此限制的方法是使用64位操作系统和64位JVM,并且该限制要高得多,具体取决于您购买的Windows的风格。 Professional edition is limited to 192 GB. 专业版限制为192 GB。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM