# Setting ES\_MIN\_MEM and ES\_MAX\_MEM

**URL:** <https://discuss.elastic.co/t/setting-es-min-mem-and-es-max-mem/15900>\
**Category:** Elasticsearch\
**Created:** [February 19, 2014, 4:57pm UTC](https://discuss.elastic.co/t/setting-es-min-mem-and-es-max-mem/15900 "2014-02-19T16:57:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo\_Musa](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@Pablo\_Musa](https://discuss.elastic.co/u/Pablo_Musa)\
**Post date:** [February 19, 2014, 4:57pm UTC](https://discuss.elastic.co/t/setting-es-min-mem-and-es-max-mem/15900/1 "2014-02-19T16:57:24Z")

</div>

Hi guys,  
I am trying to set -Xmm and -Xms when starting elasticsearch. It should be  
very easy clean, however I am using debian and I am running my  
elasticsearch by "service" command. I could put it to work editing  
.../bin/elasticsearch.in.sh or .../init.d/elasticsearch. But I don't think  
this is a good/clean solution. Is there any file where I should put these  
settings that will overwrite the default value?

I read the following links but could not find any working solution. (my  
installation does not have any elasticsearch.conf).

[http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html](http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html)  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service.html)  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html)  
[http://elasticsearch-users.115913.n3.nabble.com/Very-long-GC-td4039479.html](http://elasticsearch-users.115913.n3.nabble.com/Very-long-GC-td4039479.html)

> **[ElasticSearch and Logstash Tuning](https://jablonskis.org/2013/elasticsearch-and-logstash-tuning/index.html)**
>
> I was slightly familiar with elasticsearch and logstash before at a very
> minimum level. But just a couple of days ago I had a chance to play with both
> toys at a larger scale. I was given a box with elasticsearch, redis and
> logstash already running,...

  

> <https://stackoverflow.com/questions/12954136/how-to-set-memory-limits-to-elasticsearch-in-debian>

Thanks,  
Pablo

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d8ebe072-fb7b-4ab8-9ecc-9a3246529918%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d8ebe072-fb7b-4ab8-9ecc-9a3246529918%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 19, 2014, 9:40pm UTC](https://discuss.elastic.co/t/setting-es-min-mem-and-es-max-mem/15900/2 "2014-02-19T21:40:24Z")

</div>

/etc/default/elasticsearch is the one you want.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 20 February 2014 03:57, [pablitomusa@gmail.com](mailto:pablitomusa@gmail.com) wrote:

> Hi guys,  
> I am trying to set -Xmm and -Xms when starting elasticsearch. It should be  
> very easy clean, however I am using debian and I am running my  
> elasticsearch by "service" command. I could put it to work editing .../bin/  
> elasticsearch.in.sh or .../init.d/elasticsearch. But I don't think this  
> is a good/clean solution. Is there any file where I should put these  
> settings that will overwrite the default value?
> 
> I read the following links but could not find any working solution. (my  
> installation does not have any elasticsearch.conf).
> 
> [http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html](http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html)
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service.html)
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html)  
> [http://elasticsearch-users.115913.n3.nabble.com/Very-long-GC-td4039479.html](http://elasticsearch-users.115913.n3.nabble.com/Very-long-GC-td4039479.html)  
> [ElasticSearch and Logstash Tuning – Vaidas Jablonskis](http://jablonskis.org/2013/elasticsearch-and-logstash-tuning/index.html)
> 
> [How to set Memory limits to elasticsearch in Debian? - Stack Overflow](http://stackoverflow.com/questions/12954136/how-to-set-memory-limits-to-elasticsearch-in-debian)
> 
> Thanks,  
> Pablo
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d8ebe072-fb7b-4ab8-9ecc-9a3246529918%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d8ebe072-fb7b-4ab8-9ecc-9a3246529918%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624Y89CSLTXdXZpAOLhdFdqwYQOBwxZW-Pnz2ckz9Hbt0gg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Y89CSLTXdXZpAOLhdFdqwYQOBwxZW-Pnz2ckz9Hbt0gg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Pablo\_Musa](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@Pablo\_Musa](https://discuss.elastic.co/u/Pablo_Musa)\
**Post date:** [February 20, 2014, 4:13pm UTC](https://discuss.elastic.co/t/setting-es-min-mem-and-es-max-mem/15900/3 "2014-02-20T16:13:12Z")

</div>

Great, it worked.  
Yesterday I tried adding in this same file the option -Xms=4g in the  
ES\_JAVA\_OPTS but it was not working.  
Guess I just had to update the ES\_HEAP\_SIZE as it was overwriting my  
previous option.

Thanks a lot,  
Pablo Musa

On Wednesday, February 19, 2014 9:40:24 PM UTC, Mark Walkom wrote:

> /etc/default/elasticsearch is the one you want.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 20 February 2014 03:57, \<[pabli...@gmail.com](mailto:pabli...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi guys,  
> > I am trying to set -Xmm and -Xms when starting elasticsearch. It should  
> > be very easy clean, however I am using debian and I am running my  
> > elasticsearch by "service" command. I could put it to work editing .../bin/  
> > elasticsearch.in.sh or .../init.d/elasticsearch. But I don't think this  
> > is a good/clean solution. Is there any file where I should put these  
> > settings that will overwrite the default value?
> > 
> > I read the following links but could not find any working solution. (my  
> > installation does not have any elasticsearch.conf).
> > 
> > [http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html](http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html)
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service.html)
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html)
> > 
> > [http://elasticsearch-users.115913.n3.nabble.com/Very-long-GC-td4039479.html](http://elasticsearch-users.115913.n3.nabble.com/Very-long-GC-td4039479.html)  
> > [ElasticSearch and Logstash Tuning – Vaidas Jablonskis](http://jablonskis.org/2013/elasticsearch-and-logstash-tuning/index.html)
> > 
> > [How to set Memory limits to elasticsearch in Debian? - Stack Overflow](http://stackoverflow.com/questions/12954136/how-to-set-memory-limits-to-elasticsearch-in-debian)
> > 
> > Thanks,  
> > Pablo
> > 
> > --  
> > 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:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d8ebe072-fb7b-4ab8-9ecc-9a3246529918%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d8ebe072-fb7b-4ab8-9ecc-9a3246529918%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3e6aa2ba-30c7-42b7-a777-4a90edf33d2a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3e6aa2ba-30c7-42b7-a777-4a90edf33d2a%40googlegroups.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, 1:48am UTC](https://discuss.elastic.co/t/setting-es-min-mem-and-es-max-mem/15900/4 "2017-07-06T01:48:37Z")

</div>


