# ES heap memory and OS filecaching

**URL:** <https://discuss.elastic.co/t/es-heap-memory-and-os-filecaching/140333>\
**Category:** Elasticsearch\
**Created:** [July 17, 2018, 1:16pm UTC](https://discuss.elastic.co/t/es-heap-memory-and-os-filecaching/140333 "2018-07-17T13:16:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon24174512](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@anon24174512](https://discuss.elastic.co/u/anon24174512)\
**Post date:** [July 17, 2018, 1:16pm UTC](https://discuss.elastic.co/t/es-heap-memory-and-os-filecaching/140333/1 "2018-07-17T13:16:33Z")

</div>

Hi,

Do we have to keep the same amount of memory available for the OS as for Elasticsearch ?

So if I have 16Go memory available on the machine, should I set JMX/JMS to 8Go and keep another 8Go free for the OS in order to allow efficient filecaching ? Or can I set JMX/JMS to something like 14Go ?

---

<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:** [July 17, 2018, 1:39pm UTC](https://discuss.elastic.co/t/es-heap-memory-and-os-filecaching/140333/2 "2018-07-17T13:39:07Z")

</div>

Keeping heap at 50% of RAM is recommended as the file system cache is important for performance.

---

<div class="post-metadata">

**Author:** ![tdasch](https://avatars.discourse-cdn.com/v4/letter/t/58f4c7/32.png) [@tdasch](https://discuss.elastic.co/u/tdasch)\
**Post date:** [July 17, 2018, 5:07pm UTC](https://discuss.elastic.co/t/es-heap-memory-and-os-filecaching/140333/3 "2018-07-17T17:07:12Z")

</div>

Here are two docs to help you out with heap sizing: [the official doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html) and [a really thorough blog post](https://www.elastic.co/blog/a-heap-of-trouble). The second one is a really good read and will explain why you want to allocate about 50/50 between heap and OS. Happy reading!

---

<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:** [August 14, 2018, 5:07pm UTC](https://discuss.elastic.co/t/es-heap-memory-and-os-filecaching/140333/4 "2018-08-14T17:07:16Z")

</div>

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