# Behavior of ForceMerge

**URL:** <https://discuss.elastic.co/t/behavior-of-forcemerge/187219>\
**Category:** Elasticsearch\
**Created:** [June 25, 2019, 2:59am UTC](https://discuss.elastic.co/t/behavior-of-forcemerge/187219 "2019-06-25T02:59:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taaaak](https://avatars.discourse-cdn.com/v4/letter/t/8491ac/32.png) [@Taaaak](https://discuss.elastic.co/u/Taaaak)\
**Post date:** [June 25, 2019, 2:59am UTC](https://discuss.elastic.co/t/behavior-of-forcemerge/187219/1 "2019-06-25T02:59:53Z")

</div>

Let me ask about the behavior of \_forcemerge API including parameter `only_expunge_deletes=true`.

I'm planning to execute `_forcemerge?only_expunge_deletes=true` to large index (more over 500GB/10 datanodes) to clean up a disk space.

So my question is, does it API use additional disk space to clean deleted documents, if yes how large does it consume?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 25, 2019, 5:56am UTC](https://discuss.elastic.co/t/behavior-of-forcemerge/187219/2 "2019-06-25T05:56:18Z")

</div>

As all segments in Lucene are immutable new segments without the deleted documents will be created before the old ones are deleted. A forcemerge can therefore use a fair bit of additional disk space while it is running. I do not know how to predict exactly how much it needs as this depends on the parameters used and how the current segment distribution looks like.

---

<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 23, 2019, 5:56am UTC](https://discuss.elastic.co/t/behavior-of-forcemerge/187219/3 "2019-07-23T05:56:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
