HEAP size change

Version: 0.19.4

What is the right way to update the heap size?

I've tried exporting the following keys:

export ES_HEAP_SIZE=4g
export ES_MIN_MEM=4g
export ES_MAX_MEM=4g

But don't see anything different tacked on to the end of the process. Any
ideas?

ubuntu@ip-10-12-185-166:/etc/elasticsearch$ ps ax | grep elasticsearch
1554 ? Sl 0:15 /usr/lib/jvm/java-6-openjdk-amd64//bin/java
-Xms256m -Xmx1g -Xss256k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly
-XX:+HeapDumpOnOutOfMemoryError -Delasticsearch
-Des.pidfile=/var/run/elasticsearch.pid
-Des.path.home=/usr/share/elasticsearch -cp
:/usr/share/elasticsearch/lib/:/usr/share/elasticsearch/lib/sigar/
-Des.config=/etc/elasticsearch/elasticsearch.yml
-Des.path.home=/usr/share/elasticsearch
-Des.path.logs=/var/log/elasticsearch -Des.path.data=/var/lib/elasticsearch
-Des.path.work=/tmp/elasticsearch -Des.path.conf=/etc/elasticsearch
org.elasticsearch.bootstrap.ElasticSearch

--

Are you using the service wrapper? The settings look correct. You shouldn't
need to set the min and max since ES_HEAP_SIZE already sets both
automatically.

--
Ivan

On Wed, Dec 19, 2012 at 5:09 PM, Brandon Hilkert brandon@meeteor.comwrote:

1554 ? Sl 0:15 /usr/lib/jvm/java-6-openjdk-amd64//bin/java
-Xms256m -Xmx1g -Xss256k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly
-XX:+HeapDumpOnOutOfMemoryError -Delasticsearch
-Des.pidfile=/var/run/elasticsearch.pid
-Des.path.home=/usr/share/elasticsearch -cp
:/usr/share/elasticsearch/lib/:/usr/share/elasticsearch/lib/sigar/
-Des.config=/etc/elasticsearch/elasticsearch.yml
-Des.path.home=/usr/share/elasticsearch
-Des.path.logs=/var/log/elasticsearch -Des.path.data=/var/lib/elasticsearch
-Des.path.work=/tmp/elasticsearch -Des.path.conf=/etc/elasticsearch
org.elasticsearch.bootstrap.ElasticSearch

--

What is the right way to update the heap size?

Using the ES_HEAP_SIZE is reccomended. For the settings to be applied, it
depends on how you launch the Elasticsearch process. The service wrapper
takes this variable into account, as well as the elasticsearch script.
Many provisioning scripts set these values directly in the
https://github.com/elasticsearch/elasticsearch/blob/master/bin/elasticsearch.in.sh
file.

The most safe to have this setting applied is to pass it to the environment
when you launch the process:

$ ES_HEAP_SIZE=512m elasticsearch -f
$ ... initializing ...
$ ps aux | grep java
$ 40315   ... 

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
-Xms512m -Xmx512m ... org.elasticsearch.bootstrap.ElasticSearch

Karel

--

I do have the service wrapper installed. ES is started with the OS
(Ubuntu). I usually run "sudo service elasticsearch restart" from the
command line. I realized the service wrapper installed a scripte into
/etc/init.d/elasticsearch when i "installed" the service. That file
contained the references to the ES_HEAP_SIZE variable. I set the value in
there and it worked. Not sure why it doesn't with the ENV variable.

On Thu, Dec 20, 2012 at 3:46 AM, Karel Minařík karel.minarik@gmail.comwrote:

What is the right way to update the heap size?

Using the ES_HEAP_SIZE is reccomended. For the settings to be applied, it
depends on how you launch the Elasticsearch process. The service wrapper
takes this variable into account, as well as the elasticsearch script.
Many provisioning scripts set these values directly in the <
https://github.com/elasticsearch/elasticsearch/blob/master/bin/elasticsearch.in.sh>
file.

The most safe to have this setting applied is to pass it to the
environment when you launch the process:

$ ES_HEAP_SIZE=512m elasticsearch -f
$ ... initializing ...
$ ps aux | grep java
$ 40315   ...

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
-Xms512m -Xmx512m ... org.elasticsearch.bootstrap.ElasticSearch

Karel

--

--