Java HotSpot(TM) 64 位服务器 VM 警告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31002612/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java HotSpot(TM) 64-Bit Server VM warning
提问by Greesh Kumar
I have a tomcat as my web-server, it stopped down automatically with the given Error -
我有一个 tomcat 作为我的网络服务器,它自动停止并出现给定的错误 -
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f16a8405000, 12288, 0) failed; error='Cannot allocate memory' (errno=12)
i need to figured it out what actually happened ? and what warning does mean ?
我需要弄清楚到底发生了什么?什么警告是什么意思?
采纳答案by Manisha
There is insufficient memory for the Java Runtime Environment to continue.
没有足够的内存供 Java 运行时环境继续使用。
Native memory allocation (malloc) failed to allocate xxxxx bytes for committing reserved memory.
本机内存分配 (malloc) 未能为提交保留内存分配 xxxxx 字节。
Possible reasons:
1. The system is out of physical RAM or swap space
2. In 32 bit mode, the process size limit was hit
可能的原因:
1. 系统物理 RAM 或交换空间不足
2. 在 32 位模式下,达到了进程大小限制
Possible solutions:
1.Reduce memory load on the system
2.Increase physical memory or swap space
3.Check if swap backing store is full
4.Use 64 bit Java on a 64 bit OS
5.Decrease Java heap size (-Xmx/-Xms)
6.Decrease number of Java threads
7.Decrease Java thread stack sizes (-Xss)
8.Set larger code cache with -XX:ReservedCodeCacheSize=
if you are on JAVA-8, please ref : Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize
可能的解决方案:
1. 减少系统上的内存负载
2. 增加物理内存或交换空间 3.
检查交换后备存储是否已满
4. 在 64 位操作系统上使用 64 位 Java
5. 减少 Java 堆大小 (-Xmx/- Xms)
6. 减少 Java 线程数
7. 减少 Java 线程堆栈大小 (-Xss)
8. 使用 -XX:ReservedCodeCacheSize= 设置更大的代码缓存
如果您使用的是 JAVA-8,请参考:Java HotSpot(TM) 64-位服务器 VM 警告:忽略选项 MaxPermSize
回答by Brainsbot
Java was not able to allocate enough memory, i.e. it's not Java's heap limit that's in the way but rather no more memory available to be given to Java by OS. Check that the machine is not running out of memory. And first clean ram or increase ram then check if again there is an out of memory error then increase heap size:
Java 无法分配足够的内存,也就是说,妨碍的不是 Java 的堆限制,而是操作系统无法为 Java 提供更多可用内存。检查机器是否没有内存不足。首先清理 ram 或增加 ram 然后检查是否再次出现内存不足错误,然后增加堆大小:
-Xms128m
min(heap size)
-Xms128m
最小(堆大小)
-Xmx512m
max(heap size)
-Xmx512m
最大(堆大小)
-XX:MaxPermSize
max(perm size)
-XX:MaxPermSize
最大(烫发尺寸)