Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'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

The nodes have 128 GBs of RAM where about 120 GBs are free.

I'm using the 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?

like image 602
Björn Jacobs Avatar asked Dec 19 '13 17:12

Björn Jacobs


1 Answers

As Platypus suggested in the comments to my question, I downgraded Java to version 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. I tried it many times and the error message didn't occur a single more time.

like image 114
Björn Jacobs Avatar answered Sep 30 '22 19:09

Björn Jacobs