How to permanently change the JVM heap size for Elasticsearch ?
I edited the jvm.options
file in /etc/elasticsearch/
to raise the heap size to 2gb (by adding these 2 lines: -Xms2g -Xmx2g
), but ES still starts with default heap size (990.7mb in my case).
It seems that ES doesn't read this jvm.options
file and always uses default ones, since the JVM arguments (logged at ES launch) start with these [-Xms1g, -Xmx1g, -XX:+UseConcMar...
regardless of what is set in jvm.options
...
I also tried to set the heap size in /etc/default/elasticsearch
(by setting ES_JAVA_OPTS
to "-Xms2g -Xmx2g"
), but no way.
The only way I found to temporarily modify the heap size was setting _JAVA_OPTIONS before launching Elasticsearch :
export _JAVA_OPTIONS="-Xms2g -Xmx2g"
But it is clearly not a good option... Does anybody have a clue? Thanks!
Problem solved, I had 2 jvm.options files : one in /etc/elasticsearch/jvm.options
and one in mycustominstallfolder/config
... And of course I was setting the wrong one.
Thanks a lot @Val !
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.