Error occurred during initialization of VM Could not reserve enough space for 1048576KB object heap - ElasticSearch

Goto ElasticSearch bin directory.
Eg:\ElasticSearch\elasticsearch-2.0.0\bin

Right click elasticsearch.in.bat ->edit

change

if "%ES_MAX_MEM%" == "" (
set ES_MAX_MEM=1g
)

to

if "%ES_MAX_MEM%" == "" (
set ES_MAX_MEM=512m
)

save & close.

1 Like

Hi,

I faced same issue.

To resolve the issue:

In environment variable add new variable

Hope it helps.

Thanks,
Gaurav

3 Likes

Installation for ElasticSearch

  1. Comment entry in C:\ELK\elasticsearch-5.4.0\elasticsearch-5.4.0\config\jvm.options

#-Xms2g
#-Xmx2g

  1. set ES_JAVA_OPTS as below in elasticsearch.bat
    set ES_JAVA_OPTS = "-Xms512m -Xmx512m"