How much memory do you have allocated for that Ubuntu VM?
On Tuesday, February 15, 2011 at 6:46 AM, Tim Scott wrote:
When I try to run Elasticsearch (on a Linux Ubuntu VM) I get the
following error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
I am a Linux/Java dummy. I realize this is probably not purely an ES
issue, but I hope someone can point me in the right direction. Thanks.
1024Mb. Elasticsearch is the only thing running on that VM.
I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.
Surely 1Gb is enough with nothing else running? Do I need to up it?
By default, ES configures the JVM to have ES_MAX_MEM of 1g. The JVM will slowly increase its size and consume that memory (thats why its recommended to have MIN and MAX set to the same value).
You can decrease ES_MAX_MEM to a lower value (say, 512m).
On Tuesday, February 15, 2011 at 8:13 AM, Tim Scott wrote:
1024Mb. Elasticsearch is the only thing running on that VM.
I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.
Surely 1Gb is enough with nothing else running? Do I need to up it?
Thanks Shay. What is the correct way to set this? I added the
following line to bin/elasticsearch shell script:
ES_MIN_MEM = "512m"
It runs without error, but I don't know how to tell if it's working.
Another question. How come when I run ES from command line with -f
parameter sometimes it binds to port 9201 instead of 9200? I'm
guessing there's already a node running in the background on that
machine, but then how do I shut down that background node?
I apologize for asking what are probably very basic Linux admin
questions here. I have a lot to learn about basic Linux admin and ES
admin. Thanks.
By default, ES configures the JVM to have ES_MAX_MEM of 1g. The JVM will slowly increase its size and consume that memory (thats why its recommended to have MIN and MAX set to the same value).
You can decrease ES_MAX_MEM to a lower value (say, 512m).
On Tuesday, February 15, 2011 at 8:13 AM, Tim Scott wrote:
1024Mb. Elasticsearch is the only thing running on that VM.
I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.
Surely 1Gb is enough with nothing else running? Do I need to up it?
On Wed, 2011-02-16 at 09:28 -0800, Tim Scott wrote:
Thanks Shay. What is the correct way to set this? I added the
following line to bin/elasticsearch shell script:
ES_MIN_MEM = "512m"
You probably also want to set ES_MAX_MEM
Also, you may find the service wrapper helpful:
Here are some instructions ( a bit out of date) for setting up ES with
the service wrapper:
Another question. How come when I run ES from command line with -f
parameter sometimes it binds to port 9201 instead of 9200? I'm
guessing there's already a node running in the background on that
machine, but then how do I shut down that background node?
Yes you have. Just look for a java process with 'elasticsearch' in the
name, eg on linux:
Thanks Shay. What is the correct way to set this? I added the
following line to bin/elasticsearch shell script:
ES_MIN_MEM = "512m"
I am not sure about quotes. Try using ES_MIN_MEM=512m
It runs without error, but I don't know how to tell if it's working.
Another question. How come when I run ES from command line with -f
parameter sometimes it binds to port 9201 instead of 9200? I'm
guessing there's already a node running in the background on that
machine, but then how do I shut down that background node?
If it is an ES node (note there can be running some other process, not
related to ES at all, ES simply binds to the first empty port starting from
9200, if not configured otherwise) then you can simply kill it or send a
_shutdown request over REST API, see
If you want to kill the process from command line then you need to know the
PID. You can either learn this by running "ps -ef | grep elastic" or
directly from Admin API
(but
this requires scanning of returned JSON data)
I apologize for asking what are probably very basic Linux admin
questions here. I have a lot to learn about basic Linux admin and ES
admin. Thanks.
By default, ES configures the JVM to have ES_MAX_MEM of 1g. The JVM will
slowly increase its size and consume that memory (thats why its recommended
to have MIN and MAX set to the same value).
You can decrease ES_MAX_MEM to a lower value (say, 512m).
On Tuesday, February 15, 2011 at 8:13 AM, Tim Scott wrote:
1024Mb. Elasticsearch is the only thing running on that VM.
I should probably add that ES ran for a good while (maybe 3 days)
before it crashed and would not start again without a reboot. In that
3 days there was little to no activity on ES.
Surely 1Gb is enough with nothing else running? Do I need to up it?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.