# Disk write and eviction

**URL:** <https://discuss.elastic.co/t/disk-write-and-eviction/34903>\
**Category:** Elasticsearch\
**Created:** [November 18, 2015, 9:17am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903 "2015-11-18T09:17:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![binurajps](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@binurajps](https://discuss.elastic.co/u/binurajps)\
**Post date:** [November 18, 2015, 9:17am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/1 "2015-11-18T09:17:51Z")

</div>

Hi Team,

Elastic search able to write the data into disk?

I think the maximum heap size of the elastic search is 32GB. Once they reach the maximum will get OutOfMemory exception. Is there is any way to evict the old data from elastic search?

---

<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:** [November 18, 2015, 9:01pm UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/2 "2015-11-18T21:01:22Z")

</div>

All data is stored on disk anyway, what makes you think it's stored in memory?

---

<div class="post-metadata">

**Author:** ![binurajps](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@binurajps](https://discuss.elastic.co/u/binurajps)\
**Post date:** [November 19, 2015, 3:59am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/3 "2015-11-19T03:59:12Z")

</div>

Thanks for your reply Mark.

You mean while configuring ES we need to consider only disk space? Or we should consider memory size also? What is the purpose of configuring ES\_HEAP\_SIZE? Please find the attached image and let me know the size marked as red.

[cid:image001.png@01D122AC.6487B670]

Thanks & Regards,  
Binuraj P S

 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/910f2eacb3ee2c97125c467fe5635a7e4712c376.png)

---

<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:** [November 19, 2015, 5:44am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/4 "2015-11-19T05:44:17Z")

</div>

Heap size relates to what the JVM can use for things like querying and aggregating.

You need to take both into account, but there is no set algorithm to provide what the ratio is as each use case is different.

---

<div class="post-metadata">

**Author:** ![binurajps](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@binurajps](https://discuss.elastic.co/u/binurajps)\
**Post date:** [November 19, 2015, 6:00am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/5 "2015-11-19T06:00:16Z")

</div>

Data always taken from disk while querying from Kibana? Or the data available in Heap memory only?

Thanks & Regards,  
Binuraj P S

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 19, 2015, 7:17am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/6 "2015-11-19T07:17:18Z")

</div>

If the needed data is available from the heap it will be used. Otherwise the disk will be consulted.

---

<div class="post-metadata">

**Author:** ![binurajps](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@binurajps](https://discuss.elastic.co/u/binurajps)\
**Post date:** [November 19, 2015, 7:34am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/7 "2015-11-19T07:34:40Z")

</div>

Thank you Magnus for your support.

Please let us know the best ES\_HEAP\_SIZE configuration? It is required to configure indices.fielddata.cache.size also? If yes please let us know the best consfiguration.

Thanks & Regards,  
Binuraj P S

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 19, 2015, 7:37am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/8 "2015-11-19T07:37:52Z")

</div>

The typical advice is to set the heap size to 50% of RAM but no greater than 30 GB. Ideally you shouldn't have to set indices.fielddata.cache.size but if you don't have sufficient RAM is might be necessary. See [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_limiting\_memory\_usage.html#fielddata-size](https://www.elastic.co/guide/en/elasticsearch/guide/current/_limiting_memory_usage.html#fielddata-size).

---

<div class="post-metadata">

**Author:** ![binurajps](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@binurajps](https://discuss.elastic.co/u/binurajps)\
**Post date:** [November 19, 2015, 9:04am UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/9 "2015-11-19T09:04:21Z")

</div>

Thank you for your prompt reply.

Thanks & Regards,  
Binuraj P S

---

<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 5, 2017, 11:37pm UTC](https://discuss.elastic.co/t/disk-write-and-eviction/34903/10 "2017-07-05T23:37:22Z")

</div>


