简体   繁体   English

'Java应用程序运行时期间无法分配内存'(errno = 12)'错误

[英]'Cannot allocate memory' (errno=12)' errors during runtime of Java application

While running a distributed application, I get a lot of these errors on the server as well as on the worker nodes: 运行分布式应用程序时,我在服务器和工作节点上都会遇到很多错误:

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f4f8c800000, 549453824, 2097152, 0) failed; error='Cannot allocate memory' (errno=12)

Most of the time the process continues and finishes as expected but sometimes the process also fails. 大多数情况下,流程会按预期继续并完成,但有时流程也会失败。

I am calling my application with java -Xms512M -Xmx50G -cp myjar.jar myclass.Main 我用java -Xms512M -Xmx50G -cp myjar.jar myclass.Main调用我的应用程序java -Xms512M -Xmx50G -cp myjar.jar myclass.Main

The nodes have 128 GBs of RAM where about 120 GBs are free. 节点有128 GB的RAM,大约120 GB是免费的。

I'm using the Oracle JVM: 我正在使用Oracle JVM:

$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

What do these messages mean and how can I get rid of them? 这些消息意味着什么,我怎么能摆脱它们?

As Platypus suggested in the comments to my question, I downgraded Java to version 1.7.0_41. 正如Platypus在我的问题评论中所建议的那样,我将Java降级为1.7.0_41版​​本。 Unfortunately the problem persisted. 不幸的是问题仍然存在。

I went even farther back to version 1.7.0_25 and apparently this solved the error. 我甚至更远回到版本1.7.0_25,显然这解决了错误。 I tried it many times and the error message didn't occur a single more time. 我尝试了很多次,错误消息没有再发生一次。

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

相关问题 JVM 崩溃,错误=“无法分配内存”(errno=12) - JVM crashes with error='Cannot allocate memory' (errno=12) 如何解决“java.io.IOException:error = 12,无法分配内存”调用Runtime #exec()? - How to solve “java.io.IOException: error=12, Cannot allocate memory” calling Runtime#exec()? 即使内存可用,JVM也会因错误=“无法分配内存”而崩溃(errno = 12) - JVM crashes with error='Cannot allocate memory' (errno=12) even though memory is available hadoop无法分配内存java.io.IOException:错误= 12 - hadoop cannot allocate memory java.io.IOException: error=12 向Java应用程序分配更多内存 - Allocate more memory to java application Openshift + Jenkins在构建期间无法分配内存 - Openshift + Jenkins Cannot Allocate Memory During Build Java枚举是否在Android Runtime中分配堆内存? - Do Java enums allocate heap memory in the Android Runtime? 无法分配小内存“ java.lang.OutOfMemoryError:无法分配3000字节” - Cannot allocate small memory “java.lang.OutOfMemoryError: Cannot Allocate 3000 bytes” 如何在运行时更新Java应用程序库? - How to update library of Java application during runtime? java.net.SocketException:无法分配内存(不是Mac) - java.net.SocketException: Cannot allocate memory (not Mac)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM