Can't start elasticsearch service: "Could not reserve enough space for the object heap"

Hi,

I'm having trouble starting elastic on CentOS via the elasticsearch-service.
I get the error "Could not reserve enough space for the object heap"

I must say that I'm using a pretty low memory VPS, but I think that I
should be able to run elastic anyway.

for reference: the contents of my elasticsearch.conf:

set.default.ES_HOME=/opt/elasticsearch/elasticsearch-0.19.3
set.default.ES_HEAP_SIZE=256
set.default.ES_MIN_MEM=%ES_HEAP_SIZE%
set.default.ES_MAX_MEM=%ES_HEAP_SIZE%

#********************************************************************

Wrapper Timeout Properties

#********************************************************************

How long to wait for the JVM to start (in seconds)

wrapper.startup.timeout=300

How long to wait for the JVM to stop (in seconds)

wrapper.shutdown.timeout=300

When a ping will timeout to consider the JVM hung (in seconds)

wrapper.ping.timeout=300

#********************************************************************

Wrapper Java Properties

#********************************************************************

Java Application

wrapper.java.command=java

Tell the Wrapper to log the full generated Java command line.

#wrapper.java.command.loglevel=INFO

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

wrapper.working.dir=%ES_HOME%

Java Classpath (include wrapper.jar) Add class path elements as

needed starting from 1

wrapper.java.classpath.1=%ES_HOME%/bin/service/lib/wrapper.jar
wrapper.java.classpath.2=%ES_HOME%/lib/elasticsearch*.jar
wrapper.java.classpath.3=%ES_HOME%/lib/.jar
wrapper.java.classpath.4=%ES_HOME%/lib/sigar/
.jar

Java Library Path (location of Wrapper.DLL or libwrapper.so)

wrapper.java.library.path.1=%ES_HOME%/bin/service/lib

Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit

mode.
wrapper.java.additional.auto_bits=TRUE

Java Additional Parameters

wrapper.java.additional.1=-Delasticsearch-service
wrapper.java.additional.2=-Des.path.home=%ES_HOME%
wrapper.java.additional.3=-Xss256k
wrapper.java.additional.4=-XX:+UseParNewGC
wrapper.java.additional.5=-XX:+UseConcMarkSweepGC
wrapper.java.additional.6=-XX:CMSInitiatingOccupancyFraction=75
wrapper.java.additional.7=-XX:+UseCMSInitiatingOccupancyOnly
wrapper.java.additional.8=-XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.9=-Djava.awt.headless=true

Initial Java Heap Size (in MB)

wrapper.java.initmemory=%ES_HEAP_SIZE%

Maximum Java Heap Size (in MB)

wrapper.java.maxmemory=%ES_HEAP_SIZE%

Application parameters. Add parameters as needed starting from 1

wrapper.app.parameter.1=org.elasticsearch.bootstrap.ElasticSearchF

#********************************************************************

Wrapper Logging Properties

#********************************************************************

Enables Debug output from the Wrapper.

wrapper.debug=TRUE

Format of output for the console. (See docs for formats)

wrapper.console.format=PM

Log Level for console output. (See docs for log levels)

wrapper.console.loglevel=INFO

Log file to use for wrapper output logging.

wrapper.logfile=%ES_HOME%/logs/service.log

Format of output for the log file. (See docs for formats)

wrapper.logfile.format=LPTM

Log Level for log file output. (See docs for log levels)

wrapper.logfile.loglevel=INFO

Maximum size that the log file will be allowed to grow to before

the log is rolled. Size is specified in bytes. The default value

of 0, disables log rolling. May abbreviate with the 'k' (kb) or

'm' (mb) suffix. For example: 10m = 10 megabytes.

wrapper.logfile.maxsize=0

Maximum number of rolled log files which will be allowed before old

files are deleted. The default value of 0 implies no limit.

wrapper.logfile.maxfiles=0

Log Level for sys/event log output. (See docs for log levels)

wrapper.syslog.loglevel=NONE

#********************************************************************

Wrapper General Properties

#********************************************************************

Allow for the use of non-contiguous numbered properties

wrapper.ignore_sequence_gaps=TRUE

Title to use when running as a console

wrapper.console.title=ElasticSearch

#********************************************************************

Wrapper Windows NT/2000/XP Service Properties

#********************************************************************

WARNING - Do not modify any of these properties when an application

using this configuration file has been installed as a service.

Please uninstall the service before modifying this section. The

service can then be reinstalled.

Name of the service

wrapper.name=ElasticSearch

Display name of the service

wrapper.displayname=ElasticSearch

Description of the service

wrapper.description=Open Source, Distributed, RESTful Search Engine

Service dependencies. Add dependencies as needed starting from 1

wrapper.ntservice.dependency.1=

Mode in which the service is installed. AUTO_START, DELAY_START or

DEMAND_START
wrapper.ntservice.starttype=AUTO_START

Allow the service to interact with the desktop.

wrapper.ntservice.interactive=false

And the output of "free":

                total        used          free     shared    buffers   

cached
Mem: 524288 28672 495616 0 0
11804
-/+ buffers/cache: 16868 507420
Swap: 0 0 0

Any help would be greatly appreciated :slight_smile:

Regards,
ldx

--

Just wondering if you should not set memory settings to 256m instead of 256...

David

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 sept. 2012 à 17:01, Lorenzo Dieryckx lorenzo.dieryckx@gmail.com a écrit :

Hi,

I'm having trouble starting elastic on CentOS via the elasticsearch-service.
I get the error "Could not reserve enough space for the object heap"

I must say that I'm using a pretty low memory VPS, but I think that I should be able to run elastic anyway.

for reference: the contents of my elasticsearch.conf:
set.default.ES_HOME=/opt/elasticsearch/elasticsearch-0.19.3
set.default.ES_HEAP_SIZE=256
set.default.ES_MIN_MEM=%ES_HEAP_SIZE%
set.default.ES_MAX_MEM=%ES_HEAP_SIZE%

#********************************************************************

Wrapper Timeout Properties

#********************************************************************

How long to wait for the JVM to start (in seconds)

wrapper.startup.timeout=300

How long to wait for the JVM to stop (in seconds)

wrapper.shutdown.timeout=300

When a ping will timeout to consider the JVM hung (in seconds)

wrapper.ping.timeout=300

#********************************************************************

Wrapper Java Properties

#********************************************************************

Java Application

wrapper.java.command=java

Tell the Wrapper to log the full generated Java command line.

#wrapper.java.command.loglevel=INFO

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

wrapper.working.dir=%ES_HOME%

Java Classpath (include wrapper.jar) Add class path elements as

needed starting from 1

wrapper.java.classpath.1=%ES_HOME%/bin/service/lib/wrapper.jar
wrapper.java.classpath.2=%ES_HOME%/lib/elasticsearch*.jar
wrapper.java.classpath.3=%ES_HOME%/lib/.jar
wrapper.java.classpath.4=%ES_HOME%/lib/sigar/
.jar

Java Library Path (location of Wrapper.DLL or libwrapper.so)

wrapper.java.library.path.1=%ES_HOME%/bin/service/lib

Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode.

wrapper.java.additional.auto_bits=TRUE

Java Additional Parameters

wrapper.java.additional.1=-Delasticsearch-service
wrapper.java.additional.2=-Des.path.home=%ES_HOME%
wrapper.java.additional.3=-Xss256k
wrapper.java.additional.4=-XX:+UseParNewGC
wrapper.java.additional.5=-XX:+UseConcMarkSweepGC
wrapper.java.additional.6=-XX:CMSInitiatingOccupancyFraction=75
wrapper.java.additional.7=-XX:+UseCMSInitiatingOccupancyOnly
wrapper.java.additional.8=-XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.9=-Djava.awt.headless=true

Initial Java Heap Size (in MB)

wrapper.java.initmemory=%ES_HEAP_SIZE%

Maximum Java Heap Size (in MB)

wrapper.java.maxmemory=%ES_HEAP_SIZE%

Application parameters. Add parameters as needed starting from 1

wrapper.app.parameter.1=org.elasticsearch.bootstrap.ElasticSearchF

#********************************************************************

Wrapper Logging Properties

#********************************************************************

Enables Debug output from the Wrapper.

wrapper.debug=TRUE

Format of output for the console. (See docs for formats)

wrapper.console.format=PM

Log Level for console output. (See docs for log levels)

wrapper.console.loglevel=INFO

Log file to use for wrapper output logging.

wrapper.logfile=%ES_HOME%/logs/service.log

Format of output for the log file. (See docs for formats)

wrapper.logfile.format=LPTM

Log Level for log file output. (See docs for log levels)

wrapper.logfile.loglevel=INFO

Maximum size that the log file will be allowed to grow to before

the log is rolled. Size is specified in bytes. The default value

of 0, disables log rolling. May abbreviate with the 'k' (kb) or

'm' (mb) suffix. For example: 10m = 10 megabytes.

wrapper.logfile.maxsize=0

Maximum number of rolled log files which will be allowed before old

files are deleted. The default value of 0 implies no limit.

wrapper.logfile.maxfiles=0

Log Level for sys/event log output. (See docs for log levels)

wrapper.syslog.loglevel=NONE

#********************************************************************

Wrapper General Properties

#********************************************************************

Allow for the use of non-contiguous numbered properties

wrapper.ignore_sequence_gaps=TRUE

Title to use when running as a console

wrapper.console.title=Elasticsearch

#********************************************************************

Wrapper Windows NT/2000/XP Service Properties

#********************************************************************

WARNING - Do not modify any of these properties when an application

using this configuration file has been installed as a service.

Please uninstall the service before modifying this section. The

service can then be reinstalled.

Name of the service

wrapper.name=Elasticsearch

Display name of the service

wrapper.displayname=Elasticsearch

Description of the service

wrapper.description=Open Source, Distributed, RESTful Search Engine

Service dependencies. Add dependencies as needed starting from 1

wrapper.ntservice.dependency.1=

Mode in which the service is installed. AUTO_START, DELAY_START or DEMAND_START

wrapper.ntservice.starttype=AUTO_START

Allow the service to interact with the desktop.

wrapper.ntservice.interactive=false

And the output of "free":
total used free shared buffers cached
Mem: 524288 28672 495616 0 0 11804
-/+ buffers/cache: 16868 507420
Swap: 0 0 0

Any help would be greatly appreciated :slight_smile:

Regards,
ldx

--

Nope!

Just tried it, I get this:

wrapper | Encountered an invalid numerical value for configuration
property wrapper.java.initmemory=256m. Resolving to 256.
wrapper | Encountered an invalid numerical value for configuration
property wrapper.java.maxmemory=256m. Resolving to 256.

Op maandag 24 september 2012 17:28:31 UTC+2 schreef David Pilato het
volgende:

Just wondering if you should not set memory settings to 256m instead of
256...

David

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 sept. 2012 à 17:01, Lorenzo Dieryckx <lorenzo....@gmail.com<javascript:>>
a écrit :

Hi,

I'm having trouble starting elastic on CentOS via the
elasticsearch-service.
I get the error "Could not reserve enough space for the object heap"

I must say that I'm using a pretty low memory VPS, but I think that I
should be able to run elastic anyway.

for reference: the contents of my elasticsearch.conf:

set.default.ES_HOME=/opt/elasticsearch/elasticsearch-0.19.3
set.default.ES_HEAP_SIZE=256
set.default.ES_MIN_MEM=%ES_HEAP_SIZE%
set.default.ES_MAX_MEM=%ES_HEAP_SIZE%

#********************************************************************

Wrapper Timeout Properties

#********************************************************************

How long to wait for the JVM to start (in seconds)

wrapper.startup.timeout=300

How long to wait for the JVM to stop (in seconds)

wrapper.shutdown.timeout=300

When a ping will timeout to consider the JVM hung (in seconds)

wrapper.ping.timeout=300

#********************************************************************

Wrapper Java Properties

#********************************************************************

Java Application

wrapper.java.command=java

Tell the Wrapper to log the full generated Java command line.

#wrapper.java.command.loglevel=INFO

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

wrapper.working.dir=%ES_HOME%

Java Classpath (include wrapper.jar) Add class path elements as

needed starting from 1

wrapper.java.classpath.1=%ES_HOME%/bin/service/lib/wrapper.jar
wrapper.java.classpath.2=%ES_HOME%/lib/elasticsearch*.jar
wrapper.java.classpath.3=%ES_HOME%/lib/.jar
wrapper.java.classpath.4=%ES_HOME%/lib/sigar/
.jar

Java Library Path (location of Wrapper.DLL or libwrapper.so)

wrapper.java.library.path.1=%ES_HOME%/bin/service/lib

Java Bits. On applicable platforms, tells the JVM to run in 32 or

64-bit mode.
wrapper.java.additional.auto_bits=TRUE

Java Additional Parameters

wrapper.java.additional.1=-Delasticsearch-service
wrapper.java.additional.2=-Des.path.home=%ES_HOME%
wrapper.java.additional.3=-Xss256k
wrapper.java.additional.4=-XX:+UseParNewGC
wrapper.java.additional.5=-XX:+UseConcMarkSweepGC
wrapper.java.additional.6=-XX:CMSInitiatingOccupancyFraction=75
wrapper.java.additional.7=-XX:+UseCMSInitiatingOccupancyOnly
wrapper.java.additional.8=-XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.9=-Djava.awt.headless=true

Initial Java Heap Size (in MB)

wrapper.java.initmemory=%ES_HEAP_SIZE%

Maximum Java Heap Size (in MB)

wrapper.java.maxmemory=%ES_HEAP_SIZE%

Application parameters. Add parameters as needed starting from 1

wrapper.app.parameter.1=org.elasticsearch.bootstrap.ElasticSearchF

#********************************************************************

Wrapper Logging Properties

#********************************************************************

Enables Debug output from the Wrapper.

wrapper.debug=TRUE

Format of output for the console. (See docs for formats)

wrapper.console.format=PM

Log Level for console output. (See docs for log levels)

wrapper.console.loglevel=INFO

Log file to use for wrapper output logging.

wrapper.logfile=%ES_HOME%/logs/service.log

Format of output for the log file. (See docs for formats)

wrapper.logfile.format=LPTM

Log Level for log file output. (See docs for log levels)

wrapper.logfile.loglevel=INFO

Maximum size that the log file will be allowed to grow to before

the log is rolled. Size is specified in bytes. The default value

of 0, disables log rolling. May abbreviate with the 'k' (kb) or

'm' (mb) suffix. For example: 10m = 10 megabytes.

wrapper.logfile.maxsize=0

Maximum number of rolled log files which will be allowed before old

files are deleted. The default value of 0 implies no limit.

wrapper.logfile.maxfiles=0

Log Level for sys/event log output. (See docs for log levels)

wrapper.syslog.loglevel=NONE

#********************************************************************

Wrapper General Properties

#********************************************************************

Allow for the use of non-contiguous numbered properties

wrapper.ignore_sequence_gaps=TRUE

Title to use when running as a console

wrapper.console.title=Elasticsearch

#********************************************************************

Wrapper Windows NT/2000/XP Service Properties

#********************************************************************

WARNING - Do not modify any of these properties when an application

using this configuration file has been installed as a service.

Please uninstall the service before modifying this section. The

service can then be reinstalled.

Name of the service

wrapper.name=Elasticsearch

Display name of the service

wrapper.displayname=Elasticsearch

Description of the service

wrapper.description=Open Source, Distributed, RESTful Search Engine

Service dependencies. Add dependencies as needed starting from 1

wrapper.ntservice.dependency.1=

Mode in which the service is installed. AUTO_START, DELAY_START or

DEMAND_START
wrapper.ntservice.starttype=AUTO_START

Allow the service to interact with the desktop.

wrapper.ntservice.interactive=false

And the output of "free":

                total        used          free     shared    buffers 
cached

Mem: 524288 28672 495616 0 0
11804
-/+ buffers/cache: 16868 507420
Swap: 0 0 0

Any help would be greatly appreciated :slight_smile:

Regards,
ldx

--

--

Did you try to modify elasticsearch.yml file?

ElasticSearch performs poorly when JVM starts swapping: you should ensure

that

it never swaps.

Set this property to true to lock the memory:

bootstrap.mlockall: true

Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set

to the same value, and that the machine has enough memory to allocate

for ElasticSearch, leaving enough memory for the operating system itself.

You should also make sure that the ElasticSearch process is allowed to

lock

the memory, eg. by using ulimit -l unlimited.

De : elasticsearch@googlegroups.com [mailto:elasticsearch@googlegroups.com]
De la part de Lorenzo Dieryckx
Envoyé : lundi 24 septembre 2012 21:26
À : elasticsearch@googlegroups.com
Objet : Re: Can't start elasticsearch service: "Could not reserve enough
space for the object heap"

Nope!

Just tried it, I get this:

wrapper | Encountered an invalid numerical value for configuration property
wrapper.java.initmemory=256m. Resolving to 256.

wrapper | Encountered an invalid numerical value for configuration property
wrapper.java.maxmemory=256m. Resolving to 256.

Op maandag 24 september 2012 17:28:31 UTC+2 schreef David Pilato het
volgende:

Just wondering if you should not set memory settings to 256m instead of
256...

David

--

David :wink:

Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 sept. 2012 à 17:01, Lorenzo Dieryckx <lorenzo....@gmail.com
<javascript:> > a écrit :

Hi,

I'm having trouble starting elastic on CentOS via the elasticsearch-service.

I get the error "Could not reserve enough space for the object heap"

I must say that I'm using a pretty low memory VPS, but I think that I should
be able to run elastic anyway.

for reference: the contents of my elasticsearch.conf:

set.default.ES_HOME=/opt/elasticsearch/elasticsearch-0.19.3

set.default.ES_HEAP_SIZE=256

set.default.ES_MIN_MEM=%ES_HEAP_SIZE%

set.default.ES_MAX_MEM=%ES_HEAP_SIZE%

#********************************************************************

Wrapper Timeout Properties

#********************************************************************

How long to wait for the JVM to start (in seconds)

wrapper.startup.timeout=300

How long to wait for the JVM to stop (in seconds)

wrapper.shutdown.timeout=300

When a ping will timeout to consider the JVM hung (in seconds)

wrapper.ping.timeout=300

#********************************************************************

Wrapper Java Properties

#********************************************************************

Java Application

wrapper.java.command=java

Tell the Wrapper to log the full generated Java command line.

#wrapper.java.command.loglevel=INFO

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

wrapper.working.dir=%ES_HOME%

Java Classpath (include wrapper.jar) Add class path elements as

needed starting from 1

wrapper.java.classpath.1=%ES_HOME%/bin/service/lib/wrapper.jar

wrapper.java.classpath.2=%ES_HOME%/lib/elasticsearch*.jar

wrapper.java.classpath.3=%ES_HOME%/lib/*.jar

wrapper.java.classpath.4=%ES_HOME%/lib/sigar/*.jar

Java Library Path (location of Wrapper.DLL or libwrapper.so)

wrapper.java.library.path.1=%ES_HOME%/bin/service/lib

Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit

mode.

wrapper.java.additional.auto_bits=TRUE

Java Additional Parameters

wrapper.java.additional.1=-Delasticsearch-service

wrapper.java.additional.2=-Des.path.home=%ES_HOME%

wrapper.java.additional.3=-Xss256k

wrapper.java.additional.4=-XX:+UseParNewGC

wrapper.java.additional.5=-XX:+UseConcMarkSweepGC

wrapper.java.additional.6=-XX:CMSInitiatingOccupancyFraction=75

wrapper.java.additional.7=-XX:+UseCMSInitiatingOccupancyOnly

wrapper.java.additional.8=-XX:+HeapDumpOnOutOfMemoryError

wrapper.java.additional.9=-Djava.awt.headless=true

Initial Java Heap Size (in MB)

wrapper.java.initmemory=%ES_HEAP_SIZE%

Maximum Java Heap Size (in MB)

wrapper.java.maxmemory=%ES_HEAP_SIZE%

Application parameters. Add parameters as needed starting from 1

wrapper.app.parameter.1=org.elasticsearch.bootstrap.ElasticSearchF

#********************************************************************

Wrapper Logging Properties

#********************************************************************

Enables Debug output from the Wrapper.

wrapper.debug=TRUE

Format of output for the console. (See docs for formats)

wrapper.console.format=PM

Log Level for console output. (See docs for log levels)

wrapper.console.loglevel=INFO

Log file to use for wrapper output logging.

wrapper.logfile=%ES_HOME%/logs/service.log

Format of output for the log file. (See docs for formats)

wrapper.logfile.format=LPTM

Log Level for log file output. (See docs for log levels)

wrapper.logfile.loglevel=INFO

Maximum size that the log file will be allowed to grow to before

the log is rolled. Size is specified in bytes. The default value

of 0, disables log rolling. May abbreviate with the 'k' (kb) or

'm' (mb) suffix. For example: 10m = 10 megabytes.

wrapper.logfile.maxsize=0

Maximum number of rolled log files which will be allowed before old

files are deleted. The default value of 0 implies no limit.

wrapper.logfile.maxfiles=0

Log Level for sys/event log output. (See docs for log levels)

wrapper.syslog.loglevel=NONE

#********************************************************************

Wrapper General Properties

#********************************************************************

Allow for the use of non-contiguous numbered properties

wrapper.ignore_sequence_gaps=TRUE

Title to use when running as a console

wrapper.console.title=ElasticSearch

#********************************************************************

Wrapper Windows NT/2000/XP Service Properties

#********************************************************************

WARNING - Do not modify any of these properties when an application

using this configuration file has been installed as a service.

Please uninstall the service before modifying this section. The

service can then be reinstalled.

Name of the service

wrapper.name=ElasticSearch

Display name of the service

wrapper.displayname=ElasticSearch

Description of the service

wrapper.description=Open Source, Distributed, RESTful Search Engine

Service dependencies. Add dependencies as needed starting from 1

wrapper.ntservice.dependency.1=

Mode in which the service is installed. AUTO_START, DELAY_START or

DEMAND_START

wrapper.ntservice.starttype=AUTO_START

Allow the service to interact with the desktop.

wrapper.ntservice.interactive=false

And the output of "free":

                total        used          free     shared    buffers

cached

Mem: 524288 28672 495616 0 0
11804

-/+ buffers/cache: 16868 507420

Swap: 0 0 0

Any help would be greatly appreciated :slight_smile:

Regards,

ldx

--

--

--