# How elasticsearch uses memory

**URL:** <https://discuss.elastic.co/t/how-elasticsearch-uses-memory/227462>\
**Category:** Elasticsearch\
**Created:** [April 10, 2020, 9:02am UTC](https://discuss.elastic.co/t/how-elasticsearch-uses-memory/227462 "2020-04-10T09:02:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed\_charafouddine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmed_charafouddine/32/45129_2.png) [@ahmed\_charafouddine](https://discuss.elastic.co/u/ahmed_charafouddine)\
**Post date:** [April 10, 2020, 9:02am UTC](https://discuss.elastic.co/t/how-elasticsearch-uses-memory/227462/1 "2020-04-10T09:02:45Z")

</div>

Hello,

how elasticsearch uses memory ?  
Question which could appear naive but I cannot find a satisfactory solution. If anyone could help me. thank you

---

<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:** [April 13, 2020, 8:21am UTC](https://discuss.elastic.co/t/how-elasticsearch-uses-memory/227462/2 "2020-04-13T08:21:28Z")

</div>

Yes, it is not very clear what you are looking for. At a high level Elasticsearch uses memory in three ways. The first and most obvious one is the Java heap, which is the main way to size the memory usage of an Elasticsearch node. Elasticsearch however also requires additional off-heap memory for some data structures. The amount needed will largely depend on your data but is generally smaller than the heap. In order to get optimal performance Elasticsearch also relies on memory used by the operating system page cache to cache files frequently used. These additional types of memory is why it is not recommended to set the size of the Java heap to more than 50% of the RAM available to Elasticsearch.

---

<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:** [May 11, 2020, 8:21am UTC](https://discuss.elastic.co/t/how-elasticsearch-uses-memory/227462/3 "2020-05-11T08:21:33Z")

</div>

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