# Is it possible to get OOM due to merge

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-get-oom-due-to-merge/5229>\
**Category:** Elasticsearch\
**Created:** [August 23, 2011, 8:31pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-oom-due-to-merge/5229 "2011-08-23T20:31:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dottom](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dottom](https://discuss.elastic.co/u/dottom)\
**Post date:** [August 23, 2011, 8:31pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-oom-due-to-merge/5229/1 "2011-08-23T20:31:46Z")

</div>

We had several cases of OOM errors and I had thought it was related to  
indexing or searching, but then noticed even when ES was idle (no  
indexing or searching), an OOM would occur after 30-40 minutes of  
starting up.

I am using 8g min/max heap size, all other settings on default. Index  
size is 125gb in 200m docs per day.

When I change the max\_merged\_segment to 2g (from default of 5g), the  
OOM errors do not occur. We have the default setting of 10 segments,  
though each newly created index has between 60-70 segments after a 24-  
hour period, and auto-merge reduces that to about 50 segments after 48-  
hours. We create a index every 24 hours and rarely write to a  
previous index.

Is it possible that merging is causing the OOM?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 24, 2011, 6:19pm UTC](https://discuss.elastic.co/t/is-it-possible-to-get-oom-due-to-merge/5229/2 "2011-08-24T18:19:39Z")

</div>

Yes, merging is a process that requires memory, and can tip the memory usage  
to cause OOM.

Regarding the number of segments, they are not relevant with the new tiered  
based merge policy used.

On Tue, Aug 23, 2011 at 11:31 PM, Tom Le [dottom@gmail.com](mailto:dottom@gmail.com) wrote:

> We had several cases of OOM errors and I had thought it was related to  
> indexing or searching, but then noticed even when ES was idle (no  
> indexing or searching), an OOM would occur after 30-40 minutes of  
> starting up.
> 
> I am using 8g min/max heap size, all other settings on default. Index  
> size is 125gb in 200m docs per day.
> 
> When I change the max\_merged\_segment to 2g (from default of 5g), the  
> OOM errors do not occur. We have the default setting of 10 segments,  
> though each newly created index has between 60-70 segments after a 24-  
> hour period, and auto-merge reduces that to about 50 segments after 48-  
> hours. We create a index every 24 hours and rarely write to a  
> previous index.
> 
> Is it possible that merging is causing the OOM?

---

<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, 3:56am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-oom-due-to-merge/5229/3 "2017-07-06T03:56:10Z")

</div>


