[SOLVED] Unable to start elasticsearch - could not reserve enough space for object heap

This is driving me insane. I cannot work out why a fresh install of Java 1.8.0_121 and elasticsearch 5.2.1 is unable to start. I used elasticsearch 2.4 previously without issues, but have since removed it and tidied up my Java versions. Wanted to test out elasticsearch again, installed latest version and latest Java and just can't get it to start.

java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode)

javac -version
javac 1.8.0_121

echo %JAVA_HOME%
C:\Program Files (x86)\Java\jdk1.8.0_121

Given I am using the 32-bit JVM client I have removed -server from jvm.options and set the thread stack size to 320k.

From the elasticsearch service manager:
Java use default:

True

Java virtual machine:

c:\Program FIles (x86)\Java\jre.1.8.0_121\bin\client\jvm.dll

Java classpath:

c:\Workspace\ELK\elasticsearch-5.2.1/lib/elasticsearch-5.2.1.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/*

Java options:

-Xms2g
-Xmx2g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-Xss320k
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-Djdk.io.permissionsUseCanonicalPath=true
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-Dlog4j.skipJansi=true
-XX:+HeapDumpOnOutOfMemoryError
-Delasticsearch
-Des.path.home=c:\Workspace\ELK\elasticsearch-5.2.1
-Des.default.path.logs=c:\Workspace\ELK\elasticsearch-5.2.1\logs
-Des.default.path.data=c:\Workspace\ELK\elasticsearch-5.2.1\data
-Des.default.path.conf=c:\Workspace\ELK\elasticsearch-5.2.1\config

Initial memory pool:

2048 MB

Maximum memory pool:

2048 MB

Thread stack size:

320 KB

What am I doing wrong/missing?

Cheers,

ATC

Log:

[2017-02-27 23:16:12] [debug] ( prunsrv.c:1679) [ 648] Commons Daemon procrun log initialized
[2017-02-27 23:16:12] [info] ( prunsrv.c:1683) [ 648] Commons Daemon procrun (1.0.15.0 32-bit) started
[2017-02-27 23:16:12] [info] ( prunsrv.c:725 ) [ 648] Starting service 'elasticsearch-service-x86' ...
[2017-02-27 23:16:12] [debug] ( prunsrv.c:1679) [11756] Commons Daemon procrun log initialized
[2017-02-27 23:16:12] [info] ( prunsrv.c:1683) [11756] Commons Daemon procrun (1.0.15.0 32-bit) started
[2017-02-27 23:16:12] [info] ( prunsrv.c:1596) [11756] Running 'elasticsearch-service-x86' Service...
[2017-02-27 23:16:12] [debug] ( prunsrv.c:1374) [ 88] Inside ServiceMain...
[2017-02-27 23:16:12] [debug] ( prunsrv.c:844 ) [ 88] reportServiceStatusE: 2, 0, 3000, 0
[2017-02-27 23:16:12] [info] ( prunsrv.c:1127) [ 88] Starting service...
[2017-02-27 23:16:12] [debug] ( javajni.c:233 ) [ 88] loading jvm 'C:\Program Files (x86)\Java\jre1.8.0_121\bin\client\jvm.dll'
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[0] -Xms2g
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[1] -Xmx2g
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[2] -XX:+UseConcMarkSweepGC
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[3] -XX:CMSInitiatingOccupancyFraction=75
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[4] -XX:+UseCMSInitiatingOccupancyOnly
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[5] -XX:+DisableExplicitGC
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[6] -XX:+AlwaysPreTouch
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[7] -Xss320k
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[8] -Djava.awt.headless=true
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[9] -Dfile.encoding=UTF-8
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[10] -Djna.nosys=true
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[11] -Djdk.io.permissionsUseCanonicalPath=true
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[12] -Dio.netty.noUnsafe=true
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[13] -Dio.netty.noKeySetOptimization=true
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[14] -Dio.netty.recycler.maxCapacityPerThread=0
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[15] -Dlog4j.shutdownHookEnabled=false
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[16] -Dlog4j2.disable.jmx=true
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[17] -Dlog4j.skipJansi=true
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[18] -XX:+HeapDumpOnOutOfMemoryError
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[19] -Delasticsearch
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[20] -Des.path.home=c:\Workspace\ELK\elasticsearch-5.2.1
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[21] -Des.default.path.logs=c:\Workspace\ELK\elasticsearch-5.2.1\logs
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[22] -Des.default.path.data=c:\Workspace\ELK\elasticsearch-5.2.1\data
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[23] -Des.default.path.conf=c:\Workspace\ELK\elasticsearch-5.2.1\config
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[24] -Djava.class.path=c:\Workspace\ELK\elasticsearch-5.2.1/lib/elasticsearch-5.2.1.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/elasticsearch-5.2.1.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/HdrHistogram-2.1.6.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/hppc-0.7.1.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/jackson-core-2.8.6.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/jackson-dataformat-cbor-2.8.6.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/jackson-dataformat-smile-2.8.6.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/jackson-dataformat-yaml-2.8.6.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/jna-4.2.2.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/joda-time-2.9.5.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/jopt-simple-5.0.2.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/jts-1.13.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/log4j-1.2-api-2.7.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/log4j-api-2.7.jar;c:\Workspace\ELK\elasticsearch-5.2.1/lib/log4j-core-2.7.jar;c:\Workspace\ELK\elasticsearch-5.2.1
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[25] exit
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[26] -Xms2048m
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[27] -Xmx2048m
[2017-02-27 23:16:12] [debug] ( javajni.c:704 ) [ 9520] Jvm Option[28] -Xss320k
[2017-02-27 23:16:12] [debug] ( prunsrv.c:919 ) [ 9520] Start exit hook called ...
[2017-02-27 23:16:12] [debug] ( prunsrv.c:920 ) [ 9520] VM exit code: 0
[2017-02-27 23:16:12] [debug] ( prunsrv.c:844 ) [ 9520] reportServiceStatusE: 1, 0, 0, 0
[2017-02-27 23:16:13] [error] ( prunsrv.c:746 ) [ 648] Failed to start 'elasticsearch-service-x86' service
[2017-02-27 23:16:13] [error] ( prunsrv.c:746 ) [ 648] The specified program requires a newer version of Windows.
[2017-02-27 23:16:13] [info] ( prunsrv.c:754 ) [ 648] Start service finished.
[2017-02-27 23:16:14] [error] ( prunsrv.c:1755) [ 648] Commons Daemon procrun failed with exit value: 5 (Failed to start service)
[2017-02-27 23:16:14] [error] ( prunsrv.c:1755) [ 648] The specified program requires a newer version of Windows.

stderr

2017-02-27 23:16:12 Commons Daemon procrun stderr initialized
The specified program requires a newer version of Windows.

Failed to start service

stdout:

2017-02-27 23:16:12 Commons Daemon procrun stdout initialized
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

Nevermind - looks like a limitation with Java 32-bit client running on a 64-bit machine. Have reduced heap size to 256M and it now starts

1 Like

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