# Advice on Heap usage

**URL:** <https://discuss.elastic.co/t/advice-on-heap-usage/217752>\
**Category:** Elasticsearch\
**Created:** [February 4, 2020, 9:33am UTC](https://discuss.elastic.co/t/advice-on-heap-usage/217752 "2020-02-04T09:33:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![royal\_man](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/royal_man/32/67426_2.png) [@royal\_man](https://discuss.elastic.co/u/royal_man)\
**Post date:** [February 4, 2020, 9:33am UTC](https://discuss.elastic.co/t/advice-on-heap-usage/217752/1 "2020-02-04T09:33:55Z")

</div>

Node: 12cpu + 45GB RAM  
I have 1 shard on 1 node.  
size of 1 shard: 12GB  
Heap assigned: 20GB  
Based on the graph below. I think I should reduce the heap size but it is recommended to keep heap 50% of the RAM. Can someone suggest.

 ![Screen Shot 2020-02-04 at 18.22.24](https://us1.discourse-cdn.com/elastic/original/3X/7/2/72e811389245fca566e40d0fcc3c0b127dae61d7.png)

Also, `elasticsearch_transport_rx_packets_total` keeps on increasing and search speed becomes bad even if the CPU is 60% utilized. What changes should I perform ?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 4, 2020, 9:49am UTC](https://discuss.elastic.co/t/advice-on-heap-usage/217752/2 "2020-02-04T09:49:01Z")

</div>

> [@royal\_man](#):
>
> it is recommended to keep heap 50% of the RAM

This is not the case. The [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html) say (emphasis mine):

> Set `Xmx` and `Xms` to **no more than** 50% of your physical RAM.

You can set it to less, for sure, and this can sometimes improve performance.

---

<div class="post-metadata">

**Author:** ![royal\_man](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/royal_man/32/67426_2.png) [@royal\_man](https://discuss.elastic.co/u/royal_man)\
**Post date:** [February 4, 2020, 10:17am UTC](https://discuss.elastic.co/t/advice-on-heap-usage/217752/3 "2020-02-04T10:17:43Z")

</div>

> [@royal\_man](#):
>
> Also, `elasticsearch_transport_rx_packets_total` keeps on increasing and search speed becomes bad even if the CPU is 60% utilized. What changes should I perform ?

@DavidTurner Could you also explain this

> Also, elasticsearch\_transport\_rx\_packets\_total keeps on increasing and search speed becomes bad even if the CPU is 60% utilized. What could be the cause for this. ?

---

<div class="post-metadata">

**Author:** ![royal\_man](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/royal_man/32/67426_2.png) [@royal\_man](https://discuss.elastic.co/u/royal_man)\
**Post date:** [February 4, 2020, 10:19am UTC](https://discuss.elastic.co/t/advice-on-heap-usage/217752/4 "2020-02-04T10:19:40Z")

</div>

I found this discussion. Thanks.

> [@JVM Heap Advice from documentation](https://discuss.elastic.co/t/jvm-heap-advice-from-documentation/169827/4):
>
> Note that the documentation gives 50% as a recommended upper limit, not a target: Set Xmx to no more than 50% of your physical RAM You can of course set it lower. I think that reducing the heap size also reduces the space available for off-heap data (they share a limit) but you are right that it increases the space available for filesystem cache. Would that improve performance? It depends™ slight_smile It means a full GC would be faster, but maybe more frequent, and means it can cache …

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 4, 2020, 10:34am UTC](https://discuss.elastic.co/t/advice-on-heap-usage/217752/5 "2020-02-04T10:34:31Z")

</div>

I've no idea what `elasticsearch_transport_rx_packets_total` is, nor how it relates to your original question. Maybe open a new thread in case someone else knows.

---

<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:** [March 3, 2020, 10:37am UTC](https://discuss.elastic.co/t/advice-on-heap-usage/217752/6 "2020-03-03T10:37:03Z")

</div>

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