Change Heap_size on ElasticSearch

Hi, i Have three node. and using Java on Centos 6.2

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

I set Heap_size on three node to 8Gb ( Machine have 16Gb RAM) with Command

export ES_HEAP_SIZE=10g

I restart all Node but when i check, Heap size is 1GB ???

http://www.upsieutoc.com/images/2015/12/21/heap-size.png

http://www.upsieutoc.com/images/2015/12/21/heap-size2.png

i try to use command

bin/elasticsearch -Xmx8g -Xms8g

and get error

ERROR: Parameter [-Xmx8g]does not start with --

see if this can help you:

on Debian, you can change this setting here

/etc/default/elasticsearch

# Heap size defaults to 256m min, 1g max
# Set ES_HEAP_SIZE to 50% of available RAM, but no more than 31g
ES_HEAP_SIZE=10g

and then restart the service

1 Like

Thank for suggest :smiley:
I found config in this

/etc/sysconfig/elasticsearch

And change heap_size success !

what syntax is used o control the maximum and minimum size of the heap on the .yml file?

@arianayay

The .yml is read after elasticsearch is started, when it is too late to specify a heap (since the process has already started), that's why you can't configure it there