Could not reserve enough space for object heap to start JVM(无法为对象堆保留足够的空间来启动 JVM)
问题描述
刚刚遇到奇怪的问题.当我输入时
Just faced with strange issue. When i type
java -version
我明白了
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
.
java -Xms64m -Xmx64m -version
这个命令很好用
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode)
如果我将 xms、xmx 更改为 128m,我会再次出错.
If i change xms, xmx to 128m, i get error again.
使用 top 命令和 free -m 我可以看到,我获得了超过 192 mb 的空闲空间,那么为什么我仍然会收到此错误?
Using top command and free -m i can see, that i got over 192 mb free, so why i still get this error ?
Mem: 262144k total, 64760k used, 197384k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached
谢谢
推荐答案
您尝试运行它的机器似乎只有 256 MB 内存.
It looks like the machine you're trying to run this on has only 256 MB memory.
也许 JVM 尝试分配一个大的、连续的 64 MB 内存块.您可用的 192 MB 可能会被分割成更小的部分,因此没有 64 MB 的连续块可供分配.
Maybe the JVM tries to allocate a large, contiguous block of 64 MB memory. The 192 MB that you have free might be fragmented into smaller pieces, so that there is no contiguous block of 64 MB free to allocate.
尝试使用较小的堆大小启动 Java 程序,例如:
Try starting your Java program with a smaller heap size, for example:
java -Xms16m ...
这篇关于无法为对象堆保留足够的空间来启动 JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法为对象堆保留足够的空间来启动 JVM
基础教程推荐
- Struts2 URL 无法访问 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
