JAVA failed; error='Cannot allocate memory'

I tried to start ES using command sudo -i service elasticsearch start

Got an error

sudo -i service elasticsearch start

Starting elasticsearch: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.

An error report file with more information is saved as:

/var/log/elasticsearch/hs_err_pid30097.log

                                                       [FAILED]

I am using Amazon Linux, Java 1.8, EC 6.x

Anyone can help me?

How many RAM does your server have available? How much heap did you allocate for Elasticsearch in jvm.options?

2019-06-28_1229

With which option did you use the free command?

Also what about my question on the heap allocated in /etc/elasticsearch/jvm.options?

Hi EldrosKandar

Thanks for your replay, I apologized for the late replay now It's solved, I just upgrade Instance memory and now its work fine.

The latest version of Elastic Search not supported AWS t2.micro.

If you want a cheap and quick solution, you can have a look at cloud.elastic.co. It starts at $17 per month IIRC.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.