# ES\_MIN\_MEM and ES\_MAX\_MEM settings

**URL:** <https://discuss.elastic.co/t/es-min-mem-and-es-max-mem-settings/13588>\
**Category:** Elasticsearch\
**Created:** [September 13, 2013, 6:50am UTC](https://discuss.elastic.co/t/es-min-mem-and-es-max-mem-settings/13588 "2013-09-13T06:50:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashwin\_Sathya](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Ashwin\_Sathya](https://discuss.elastic.co/u/Ashwin_Sathya)\
**Post date:** [September 13, 2013, 6:50am UTC](https://discuss.elastic.co/t/es-min-mem-and-es-max-mem-settings/13588/1 "2013-09-13T06:50:32Z")

</div>

HI,

My ES setup ran out of heap space and is throwing  
"java.lang.OutOfMemoryError: Java heap space"

I understand I have to configure the ES\_MAX\_MEM environment variable. Now,  
ES is the only process running on the machine (i.e) it is a dedicated search  
server. My VM runs on a 14 G available run. I want to give maximum memory to  
ES. Is it recommended that I set it to 12-13 G (leaving 1-2G for OS) ?

Thanks,

AshwinSa

--  
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:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 13, 2013, 7:16am UTC](https://discuss.elastic.co/t/es-min-mem-and-es-max-mem-settings/13588/2 "2013-09-13T07:16:12Z")

</div>

Hey,

usually you should give the ES process half of your available RAM, as the  
other RAM then is used to cache files in memory for faster access  
(resulting in faster searches).

Maybe it might make sense to find out, why you are getting these OOM  
exceptions. Do you know what triggers them?

--Alex

On Fri, Sep 13, 2013 at 8:50 AM, R Ashwin Sathya  
[ashwin.sathya@outlook.com](mailto:ashwin.sathya@outlook.com)wrote:

> HI,\*\*\*\*
> 
> * * *
> 
> My ES setup ran out of heap space and is throwing  
> “java.lang.OutOfMemoryError: Java heap space”\*\*\*\*
> 
> I understand I have to configure the ES\_MAX\_MEM environment variable. Now,  
> ES is the only process running on the machine (i.e) it is a dedicated  
> search server. My VM runs on a 14 G available run. I want to give maximum  
> memory to ES. Is it recommended that I set it to 12-13 G (leaving 1-2G for  
> OS) ?\*\*\*\*
> 
> * * *
> 
> Thanks,\*\*\*\*
> 
> AshwinSa\*\*\*\*
> 
> --  
> 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:** ![Ashwin\_Sathya](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Ashwin\_Sathya](https://discuss.elastic.co/u/Ashwin_Sathya)\
**Post date:** [September 13, 2013, 7:17am UTC](https://discuss.elastic.co/t/es-min-mem-and-es-max-mem-settings/13588/3 "2013-09-13T07:17:53Z")

</div>

Okay. Perfect. I will use a 7G as a setting then.

My hypothesis for OOM is I was running a large data pump to push data  
(3-node cluster around 200 million documents) and the MAX\_SIZE was set to 1G

Thanks,

Ashwin Sathya

From: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)]  
On Behalf Of Alexander Reelsen  
Sent: September 13, 2013 12:46  
To: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Subject: Re: ES\_MIN\_MEM and ES\_MAX\_MEM settings

Hey,

usually you should give the ES process half of your available RAM, as the  
other RAM then is used to cache files in memory for faster access (resulting  
in faster searches).

Maybe it might make sense to find out, why you are getting these OOM  
exceptions. Do you know what triggers them?

--Alex

On Fri, Sep 13, 2013 at 8:50 AM, R Ashwin Sathya \<[ashwin.sathya@outlook.com](mailto:ashwin.sathya@outlook.com)  
[mailto:ashwin.sathya@outlook.com](mailto:ashwin.sathya@outlook.com) \> wrote:

HI,

My ES setup ran out of heap space and is throwing  
"java.lang.OutOfMemoryError: Java heap space"

I understand I have to configure the ES\_MAX\_MEM environment variable. Now,  
ES is the only process running on the machine (i.e) it is a dedicated search  
server. My VM runs on a 14 G available run. I want to give maximum memory to  
ES. Is it recommended that I set it to 12-13 G (leaving 1-2G for OS) ?

Thanks,

AshwinSa

--  
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)  
[mailto:elasticsearch%2Bunsubscribe@googlegroups.com](mailto:elasticsearch%2Bunsubscribe@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)  
[mailto: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:** ![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:16am UTC](https://discuss.elastic.co/t/es-min-mem-and-es-max-mem-settings/13588/4 "2017-07-06T02:16:44Z")

</div>


