# Set ES\_MIN\_MEM in elasticsearch.yml not work

**URL:** <https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442>\
**Category:** Elasticsearch\
**Created:** [September 3, 2013, 10:19am UTC](https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442 "2013-09-03T10:19:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lijionly](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lijionly](https://discuss.elastic.co/u/lijionly)\
**Post date:** [September 3, 2013, 10:19am UTC](https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442/1 "2013-09-03T10:19:33Z")

</div>

Hi,  
I'm using elasticsearch 0.90.2, install elasticsearch with wrapper. And  
modify elasticsearch.yml as below:  
ES\_MIN\_MEM: 2048m  
ES\_MAX\_MEM: 2048m

restart elasticsearch service.  
check es process and found it starts with -Xms1024m -Xmx1024m, should it  
be changed to 2048m?

ps -ef|grep elasticsearch  
501 6615 1 0 01:57 pts/0 00:00:12 /usr/local/java/bin/java  
-Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC  
-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75  
-XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError  
-Delasticsearch -Des.path.home=/usr/local/elasticsearch -cp  
:/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/_:/usr/local/elasticsearch/lib/sigar/_  
org.elasticsearch.bootstrap.ElasticSearch  
501 9291 1 0 02:19 ? 00:00:00  
/usr/local/elasticsearch/bin/service/exec/elasticsearch-linux-x86-64  
/usr/local/elasticsearch/bin/service/elasticsearch.conf  
wrapper.syslog.ident=elasticsearch  
wrapper.pidfile=/usr/local/elasticsearch/bin/service/./elasticsearch.pid  
wrapper.name=elasticsearch wrapper.displayname=ElasticSearch  
wrapper.daemonize=TRUE  
wrapper.statusfile=/usr/local/elasticsearch/bin/service/./elasticsearch.status  
wrapper.java.statusfile=/usr/local/elasticsearch/bin/service/./elasticsearch.java.status  
wrapper.script.version=3.5.14  
501 9293 9291 16 02:20 ? 00:00:05  
/usr/local/jdk1.6.0\_34/bin/java -Delasticsearch-service  
-Des.path.home=/usr/local/elasticsearch -Xss256k -XX:+UseParNewGC  
-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75  
-XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError  
-Djava.awt.headless=true -Xms1024m -Xmx1024m  
-Djava.library.path=/usr/local/elasticsearch/bin/service/lib -classpath  
/usr/local/elasticsearch/bin/service/lib/wrapper.jar:/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/jna-3.3.0.jar:/usr/local/elasticsearch/lib/jts-1.12.jar:/usr/local/elasticsearch/lib/log4j-1.2.17.jar:/usr/local/elasticsearch/lib/lucene-analyzers-common-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-codecs-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-core-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-grouping-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-highlighter-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-join-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-memory-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-queries-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-queryparser-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-sandbox-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-spatial-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-suggest-4.3.1.jar:/usr/local/elasticsearch/lib/spatial4j-0.3.jar:/usr/local/elasticsearch/lib/sigar/sigar-1.6.4.jar  
-Dwrapper.key=YiWMu02nNu-beU4M -Dwrapper.port=32000  
-Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999  
-Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=9291  
-Dwrapper.version=3.5.14 -Dwrapper.native\_library=wrapper  
-Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
org.tanukisoftware.wrapper.WrapperSimpleApp  
org.elasticsearch.bootstrap.ElasticSearchF

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [September 3, 2013, 11:12am UTC](https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442/2 "2013-09-03T11:12:37Z")

</div>

Hello,

That setting isn't in elasticsearch.yml. Try changing elasticsearch.conf of  
the service wrapper:

set.default.ES\_HEAP\_SIZE=1024

or the ES\_HEAP\_SIZE environment variable. No "m" is needed in the end, the  
size is in MB.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Tue, Sep 3, 2013 at 1:19 PM, [lijionly@gmail.com](mailto:lijionly@gmail.com) wrote:

> Hi,  
> I'm using elasticsearch 0.90.2, install elasticsearch with wrapper. And  
> modify elasticsearch.yml as below:  
> ES\_MIN\_MEM: 2048m  
> ES\_MAX\_MEM: 2048m
> 
> restart elasticsearch service.  
> check es process and found it starts with -Xms1024m -Xmx1024m, should it  
> be changed to 2048m?
> 
> ps -ef|grep elasticsearch  
> 501 6615 1 0 01:57 pts/0 00:00:12 /usr/local/java/bin/java  
> -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC  
> -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75  
> -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError  
> -Delasticsearch -Des.path.home=/usr/local/elasticsearch -cp  
> :/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/_:/usr/local/elasticsearch/lib/sigar/_  
> org.elasticsearch.bootstrap.Elasticsearch  
> 501 9291 1 0 02:19 ? 00:00:00  
> /usr/local/elasticsearch/bin/service/exec/elasticsearch-linux-x86-64  
> /usr/local/elasticsearch/bin/service/elasticsearch.conf  
> wrapper.syslog.ident=elasticsearch  
> wrapper.pidfile=/usr/local/elasticsearch/bin/service/./elasticsearch.pid  
> wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> wrapper.daemonize=TRUE  
> wrapper.statusfile=/usr/local/elasticsearch/bin/service/./elasticsearch.status  
> wrapper.java.statusfile=/usr/local/elasticsearch/bin/service/./elasticsearch.java.status  
> wrapper.script.version=3.5.14  
> 501 9293 9291 16 02:20 ? 00:00:05  
> /usr/local/jdk1.6.0\_34/bin/java -Delasticsearch-service  
> -Des.path.home=/usr/local/elasticsearch -Xss256k -XX:+UseParNewGC  
> -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75  
> -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError  
> -Djava.awt.headless=true -Xms1024m -Xmx1024m  
> -Djava.library.path=/usr/local/elasticsearch/bin/service/lib -classpath  
> /usr/local/elasticsearch/bin/service/lib/wrapper.jar:/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/jna-3.3.0.jar:/usr/local/elasticsearch/lib/jts-1.12.jar:/usr/local/elasticsearch/lib/log4j-1.2.17.jar:/usr/local/elasticsearch/lib/lucene-analyzers-common-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-codecs-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-core-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-grouping-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-highlighter-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-join-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-memory-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-queries-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-queryparser-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-sandbox-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-spatial-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-suggest-4.3.1.jar:/usr/local/elasticsearch/lib/spatial4j-0.3.jar:/usr/local/elasticsearch/lib/sigar/sigar-1.6.4.jar  
> -Dwrapper.key=YiWMu02nNu-beU4M -Dwrapper.port=32000  
> -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999  
> -Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=9291  
> -Dwrapper.version=3.5.14 -Dwrapper.native\_library=wrapper  
> -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> org.tanukisoftware.wrapper.WrapperSimpleApp  
> org.elasticsearch.bootstrap.ElasticSearchF
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![lijionly](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lijionly](https://discuss.elastic.co/u/lijionly)\
**Post date:** [September 3, 2013, 2:09pm UTC](https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442/3 "2013-09-03T14:09:06Z")

</div>

Thanks,  
I tried elasticsearch.conf as below:  
set.default.ES\_HOME=  
set.default.ES\_HEAP\_SIZE=1024  
set.default.ES\_MIN\_MEM=256  
set.default.ES\_MAX\_MEM=1024

And restart elasticsearch, but the process still with the -Xms1024m  
-Xmx1024m

在 2013年9月3日星期二UTC+8下午7时12分37秒，Radu Gheorghe写道：

> Hello,
> 
> That setting isn't in elasticsearch.yml. Try changing elasticsearch.conf  
> of the service wrapper:
> 
> set.default.ES\_HEAP\_SIZE=1024
> 
> or the ES\_HEAP\_SIZE environment variable. No "m" is needed in the end,  
> the size is in MB.
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> On Tue, Sep 3, 2013 at 1:19 PM, \<[liji...@gmail.com](mailto:liji...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi,  
> > I'm using elasticsearch 0.90.2, install elasticsearch with wrapper. And  
> > modify elasticsearch.yml as below:  
> > ES\_MIN\_MEM: 2048m  
> > ES\_MAX\_MEM: 2048m
> > 
> > restart elasticsearch service.  
> > check es process and found it starts with -Xms1024m -Xmx1024m, should it  
> > be changed to 2048m?
> > 
> > ps -ef|grep elasticsearch  
> > 501 6615 1 0 01:57 pts/0 00:00:12 /usr/local/java/bin/java  
> > -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC  
> > -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75  
> > -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError  
> > -Delasticsearch -Des.path.home=/usr/local/elasticsearch -cp  
> > :/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/_:/usr/local/elasticsearch/lib/sigar/_  
> > org.elasticsearch.bootstrap.Elasticsearch  
> > 501 9291 1 0 02:19 ? 00:00:00  
> > /usr/local/elasticsearch/bin/service/exec/elasticsearch-linux-x86-64  
> > /usr/local/elasticsearch/bin/service/elasticsearch.conf  
> > wrapper.syslog.ident=elasticsearch  
> > wrapper.pidfile=/usr/local/elasticsearch/bin/service/./elasticsearch.pid  
> > wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> > wrapper.daemonize=TRUE  
> > wrapper.statusfile=/usr/local/elasticsearch/bin/service/./elasticsearch.status  
> > wrapper.java.statusfile=/usr/local/elasticsearch/bin/service/./elasticsearch.java.status  
> > wrapper.script.version=3.5.14  
> > 501 9293 9291 16 02:20 ? 00:00:05  
> > /usr/local/jdk1.6.0\_34/bin/java -Delasticsearch-service  
> > -Des.path.home=/usr/local/elasticsearch -Xss256k -XX:+UseParNewGC  
> > -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75  
> > -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError  
> > -Djava.awt.headless=true -Xms1024m -Xmx1024m  
> > -Djava.library.path=/usr/local/elasticsearch/bin/service/lib -classpath  
> > /usr/local/elasticsearch/bin/service/lib/wrapper.jar:/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/elasticsearch-0.90.2.jar:/usr/local/elasticsearch/lib/jna-3.3.0.jar:/usr/local/elasticsearch/lib/jts-1.12.jar:/usr/local/elasticsearch/lib/log4j-1.2.17.jar:/usr/local/elasticsearch/lib/lucene-analyzers-common-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-codecs-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-core-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-grouping-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-highlighter-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-join-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-memory-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-queries-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-queryparser-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-sandbox-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-spatial-4.3.1.jar:/usr/local/elasticsearch/lib/lucene-suggest-4.3.1.jar:/usr/local/elasticsearch/lib/spatial4j-0.3.jar:/usr/local/elasticsearch/lib/sigar/sigar-1.6.4.jar  
> > -Dwrapper.key=YiWMu02nNu-beU4M -Dwrapper.port=32000  
> > -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999  
> > -Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=9291  
> > -Dwrapper.version=3.5.14 -Dwrapper.native\_library=wrapper  
> > -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > org.tanukisoftware.wrapper.WrapperSimpleApp  
> > org.elasticsearch.bootstrap.ElasticSearchF
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [September 4, 2013, 3:47pm UTC](https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442/4 "2013-09-04T15:47:14Z")

</div>

That is correct, since ES\_HEAP\_SIZE has precedence. ES\_HEAP\_SIZE will be  
used for both Xms and Xmx.

From elasticsearch.in.sh:

if ["x$ES\_MIN\_MEM" = "x"]; then  
ES\_MIN\_MEM=256m  
fi  
if ["x$ES\_MAX\_MEM" = "x"]; then  
ES\_MAX\_MEM=1g  
fi  
if ["x$ES\_HEAP\_SIZE" != "x"]; then  
ES\_MIN\_MEM=$ES\_HEAP\_SIZE  
ES\_MAX\_MEM=$ES\_HEAP\_SIZE  
fi

The last if statement will overwrite the min/max settings if the heap size  
is specified.

Cheers,

Ivan

On Tue, Sep 3, 2013 at 7:09 AM, [lijionly@gmail.com](mailto:lijionly@gmail.com) wrote:

> Thanks,  
> I tried elasticsearch.conf as below:  
> set.default.ES\_HOME=  
> set.default.ES\_HEAP\_SIZE=1024  
> set.default.ES\_MIN\_MEM=256  
> set.default.ES\_MAX\_MEM=1024
> 
> And restart elasticsearch, but the process still with the -Xms1024m  
> -Xmx1024m
> 
> 在 2013年9月3日星期二UTC+8下午7时12分37秒，Radu Gheorghe写道：
> 
> > Hello,
> > 
> > That setting isn't in elasticsearch.yml. Try changing elasticsearch.conf  
> > of the service wrapper:
> > 
> > set.default.ES\_HEAP\_SIZE=1024
> > 
> > or the ES\_HEAP\_SIZE environment variable. No "m" is needed in the end,  
> > the size is in MB.
> > 
> > ## Best regards, Radu
> > 
> > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> > 
> > On Tue, Sep 3, 2013 at 1:19 PM, [liji...@gmail.com](mailto:liji...@gmail.com) wrote:
> > 
> > > Hi,  
> > > I'm using elasticsearch 0.90.2, install elasticsearch with wrapper. And  
> > > modify elasticsearch.yml as below:  
> > > ES\_MIN\_MEM: 2048m  
> > > ES\_MAX\_MEM: 2048m
> > > 
> > > restart elasticsearch service.  
> > > check es process and found it starts with -Xms1024m -Xmx1024m, should  
> > > it be changed to 2048m?
> > > 
> > > ps -ef|grep elasticsearch  
> > > 501 6615 1 0 01:57 pts/0 00:00:12 /usr/local/java/bin/java  
> > > -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC  
> > > -XX:+UseConcMarkSweepGC -XX: **CMSInitiatingOccupancyFraction** =75 -XX:+\*  
> > > _UseCMSInitiatingOccupancyOnly -XX:+\*\*HeapDumpOnOutOfMemoryError  
> > > -Delasticsearch -Des.path.home=/usr/local/\*\*elasticsearch -cp  
> > > :/usr/local/elasticsearch/lib/ **elasticsearch-0.90.2.jar:/usr/**  
> > > local/elasticsearch/lib/_:/\*\*usr/local/elasticsearch/lib/\*_sigar/_  
> > > org.elasticsearch.bootstrap.\*\*Elasticsearch  
> > > 501 9291 1 0 02:19 ? 00:00:00  
> > > /usr/local/elasticsearch/bin/\*\*service/exec/elasticsearch-\*\*linux-x86-64  
> > > /usr/local/elasticsearch/bin/\*\*service/elasticsearch.conf  
> > > wrapper.syslog.ident= **elasticsearch wrapper.pidfile=/usr/local/**  
> > > elasticsearch/bin/service/./\*\*elasticsearch.pid wrapper.name=elasticsearch  
> > > wrapper.displayname=\*\*Elasticsearch wrapper.daemonize=TRUE  
> > > wrapper.statusfile=/usr/local/\*\*elasticsearch/bin/service/./\*\*elasticsearch.status  
> > > wrapper.java.statusfile=/usr/ **local/elasticsearch/bin/**  
> > > service/./elasticsearch.java.\*\*status wrapper.script.version=3.5.14  
> > > 501 9293 9291 16 02:20 ? 00:00:05  
> > > /usr/local/jdk1.6.0\_34/bin/\*\*java -Delasticsearch-service  
> > > -Des.path.home=/usr/local/\*_elasticsearch -Xss256k -XX:+UseParNewGC  
> > > -XX:+UseConcMarkSweepGC -XX: **CMSInitiatingOccupancyFraction** =75 -XX:+_  
> > > \*UseCMSInitiatingOccupancyOnly -XX:+**HeapDumpOnOutOfMemoryError  
> > > -Djava.awt.headless=true -Xms1024m -Xmx1024m -Djava.library.path=/usr/**  
> > > local/elasticsearch/bin/\*\*service/lib -classpath  
> > > /usr/local/elasticsearch/bin/ **service/lib/wrapper.jar:/usr/**  
> > > local/elasticsearch/lib/ **elasticsearch-0.90.2.jar:/usr/**  
> > > local/elasticsearch/lib/ **elasticsearch-0.90.2.jar:/usr/**  
> > > local/elasticsearch/lib/jna-3. **3.0.jar:/usr/local/**  
> > > elasticsearch/lib/jts-1.12. **jar:/usr/local/elasticsearch/**  
> > > lib/log4j-1.2.17.jar:/usr/ **local/elasticsearch/lib/**  
> > > lucene-analyzers-common-4.3.1. **jar:/usr/local/elasticsearch/**  
> > > lib/lucene-codecs-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > lucene-core-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > lucene-grouping-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > lucene-highlighter-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > lucene-join-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > lucene-memory-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > lucene-queries-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > lucene-queryparser-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > lucene-sandbox-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > lucene-spatial-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > lucene-suggest-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > spatial4j-0.3.jar:/usr/local/\*\*elasticsearch/lib/sigar/sigar-\*\*1.6.4.jar  
> > > -Dwrapper.key=YiWMu02nNu-beU4M -Dwrapper.port=32000  
> > > -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999  
> > > -Dwrapper.disable\_console\_\*\*input=TRUE -Dwrapper.pid=9291  
> > > -Dwrapper.version=3.5.14 -Dwrapper.native\_library=\*\*wrapper  
> > > -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > > org.tanukisoftware.wrapper.\*\*WrapperSimpleApp  
> > > org.elasticsearch.bootstrap.\*\*ElasticSearchF
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![lijionly](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lijionly](https://discuss.elastic.co/u/lijionly)\
**Post date:** [September 6, 2013, 3:15am UTC](https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442/5 "2013-09-06T03:15:19Z")

</div>

Thank you! now I get it.

在 2013年9月4日星期三UTC+8下午11时47分14秒，Ivan Brusic写道：

> That is correct, since ES\_HEAP\_SIZE has precedence. ES\_HEAP\_SIZE will be  
> used for both Xms and Xmx.
> 
> From elasticsearch.in.sh:
> 
> if ["x$ES\_MIN\_MEM" = "x"]; then  
> ES\_MIN\_MEM=256m  
> fi  
> if ["x$ES\_MAX\_MEM" = "x"]; then  
> ES\_MAX\_MEM=1g  
> fi  
> if ["x$ES\_HEAP\_SIZE" != "x"]; then  
> ES\_MIN\_MEM=$ES\_HEAP\_SIZE  
> ES\_MAX\_MEM=$ES\_HEAP\_SIZE  
> fi
> 
> The last if statement will overwrite the min/max settings if the heap size  
> is specified.
> 
> Cheers,
> 
> Ivan
> 
> On Tue, Sep 3, 2013 at 7:09 AM, \<[liji...@gmail.com](mailto:liji...@gmail.com) \<javascript:\>\> wrote:
> 
> > Thanks,  
> > I tried elasticsearch.conf as below:  
> > set.default.ES\_HOME=  
> > set.default.ES\_HEAP\_SIZE=1024  
> > set.default.ES\_MIN\_MEM=256  
> > set.default.ES\_MAX\_MEM=1024
> > 
> > And restart elasticsearch, but the process still with the -Xms1024m  
> > -Xmx1024m
> > 
> > 在 2013年9月3日星期二UTC+8下午7时12分37秒，Radu Gheorghe写道：
> > 
> > > Hello,
> > > 
> > > That setting isn't in elasticsearch.yml. Try changing elasticsearch.conf  
> > > of the service wrapper:
> > > 
> > > set.default.ES\_HEAP\_SIZE=1024
> > > 
> > > or the ES\_HEAP\_SIZE environment variable. No "m" is needed in the end,  
> > > the size is in MB.
> > > 
> > > ## Best regards, Radu
> > > 
> > > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> > > 
> > > On Tue, Sep 3, 2013 at 1:19 PM, [liji...@gmail.com](mailto:liji...@gmail.com) wrote:
> > > 
> > > > Hi,  
> > > > I'm using elasticsearch 0.90.2, install elasticsearch with wrapper. And  
> > > > modify elasticsearch.yml as below:  
> > > > ES\_MIN\_MEM: 2048m  
> > > > ES\_MAX\_MEM: 2048m
> > > > 
> > > > restart elasticsearch service.  
> > > > check es process and found it starts with -Xms1024m -Xmx1024m, should  
> > > > it be changed to 2048m?
> > > > 
> > > > ps -ef|grep elasticsearch  
> > > > 501 6615 1 0 01:57 pts/0 00:00:12  
> > > > /usr/local/java/bin/java -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true  
> > > > -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:\*\*  
> > > > CMSInitiatingOccupancyFraction\*\*=75 -XX:+\*\*UseCMSInitiatingOccupancyOnly  
> > > > -XX:+\*\*HeapDumpOnOutOfMemoryError -Delasticsearch  
> > > > -Des.path.home=/usr/local/\*\*elasticsearch -cp  
> > > > :/usr/local/elasticsearch/lib/ **elasticsearch-0.90.2.jar:/usr/**  
> > > > local/elasticsearch/lib/\*:/\*\*usr/local/elasticsearch/lib/\*_sigar/_  
> > > > org.elasticsearch.bootstrap.\*\*Elasticsearch  
> > > > 501 9291 1 0 02:19 ? 00:00:00  
> > > > /usr/local/elasticsearch/bin/\*\*service/exec/elasticsearch-\*\*linux-x86-64  
> > > > /usr/local/elasticsearch/bin/\*\*service/elasticsearch.conf  
> > > > wrapper.syslog.ident= **elasticsearch wrapper.pidfile=/usr/local/**  
> > > > elasticsearch/bin/service/./\*\*elasticsearch.pid wrapper.name=elasticsearch  
> > > > wrapper.displayname=\*\*Elasticsearch wrapper.daemonize=TRUE  
> > > > wrapper.statusfile=/usr/local/\*\*elasticsearch/bin/service/./\*\*elasticsearch.status  
> > > > wrapper.java.statusfile=/usr/ **local/elasticsearch/bin/**  
> > > > service/./elasticsearch.java.\*\*status wrapper.script.version=3.5.14  
> > > > 501 9293 9291 16 02:20 ? 00:00:05  
> > > > /usr/local/jdk1.6.0\_34/bin/\*\*java -Delasticsearch-service  
> > > > -Des.path.home=/usr/local/\*\*elasticsearch -Xss256k -XX:+UseParNewGC  
> > > > -XX:+UseConcMarkSweepGC -XX: **CMSInitiatingOccupancyFraction** =75 -XX:+  
> > > > \*\*UseCMSInitiatingOccupancyOnly -XX:+\*_HeapDumpOnOutOfMemoryError  
> > > > -Djava.awt.headless=true -Xms1024m -Xmx1024m -Djava.library.path=/usr/_  
> > > > \*local/elasticsearch/bin/\*\*service/lib -classpath  
> > > > /usr/local/elasticsearch/bin/ **service/lib/wrapper.jar:/usr/**  
> > > > local/elasticsearch/lib/ **elasticsearch-0.90.2.jar:/usr/**  
> > > > local/elasticsearch/lib/ **elasticsearch-0.90.2.jar:/usr/**  
> > > > local/elasticsearch/lib/jna-3. **3.0.jar:/usr/local/**  
> > > > elasticsearch/lib/jts-1.12. **jar:/usr/local/elasticsearch/**  
> > > > lib/log4j-1.2.17.jar:/usr/ **local/elasticsearch/lib/**  
> > > > lucene-analyzers-common-4.3.1. **jar:/usr/local/elasticsearch/**  
> > > > lib/lucene-codecs-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > > lucene-core-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > > lucene-grouping-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > > lucene-highlighter-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > > lucene-join-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > > lucene-memory-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > > lucene-queries-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > > lucene-queryparser-4.3.1.jar:/ **usr/local/elasticsearch/lib/**  
> > > > lucene-sandbox-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > > lucene-spatial-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > > lucene-suggest-4.3.1.jar:/usr/ **local/elasticsearch/lib/**  
> > > > spatial4j-0.3.jar:/usr/local/\*\*elasticsearch/lib/sigar/sigar-\*\*1.6.4.jar  
> > > > -Dwrapper.key=YiWMu02nNu-beU4M -Dwrapper.port=32000  
> > > > -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999  
> > > > -Dwrapper.disable\_console\_\*\*input=TRUE -Dwrapper.pid=9291  
> > > > -Dwrapper.version=3.5.14 -Dwrapper.native\_library=\*\*wrapper  
> > > > -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > > > org.tanukisoftware.wrapper.\*\*WrapperSimpleApp  
> > > > org.elasticsearch.bootstrap.\*\*ElasticSearchF
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > .
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:17am UTC](https://discuss.elastic.co/t/set-es-min-mem-in-elasticsearch-yml-not-work/13442/6 "2017-07-06T02:17:55Z")

</div>


