Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch 5.2.0 - Could not reserve enough space for 2097152KB object heap

On my Windows 10 machine I'm trying to start Elasticsearch 5.2.0 which fails with a following error:

D:\Tools\elasticsearch-5.2.0\bin>elasticsearch.bat
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

Right now I have 20GB free RAM.

How to resolve this issue ?

like image 241
alexanoid Avatar asked Feb 13 '17 09:02

alexanoid


1 Answers

Change the JVM options of Elasticsearch before launch it.

Basically go to your config/jvm.options and change the values of

-Xms2g ---> to some megabytes (200 MB)
-Xmx2g ---> to some megabytes (500 MB) 

here 2g refers to 2GB so change to 200MB it should 200m
For example change it to below value
-Xms200m
-Xmx500m

It worked for me.

like image 131
Ualter Jr. Avatar answered Nov 15 '22 05:11

Ualter Jr.