# JVM heap size arguments

**URL:** <https://discuss.elastic.co/t/jvm-heap-size-arguments/301343>\
**Category:** Elasticsearch\
**Created:** [April 1, 2022, 3:05pm UTC](https://discuss.elastic.co/t/jvm-heap-size-arguments/301343 "2022-04-01T15:05:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo\_Collette](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leo_collette/32/103839_2.png) [@Leo\_Collette](https://discuss.elastic.co/u/Leo_Collette)\
**Post date:** [April 1, 2022, 3:05pm UTC](https://discuss.elastic.co/t/jvm-heap-size-arguments/301343/1 "2022-04-01T15:05:32Z")

</div>

hello guys, in my system we adopted a pattern of adjusting the heap size parameter to 1G, but over time the service ends up consuming more than this value, is this ok or not? another question, does adjusting a limit for the heap size have any risk of problems? index corruption or something?  
other question, why Elasticsearch does so much swap? how can i disable swap in Elasticsearch? Am I at risk with this?

 ![2022-04-01_12-02](https://us1.discourse-cdn.com/elastic/original/3X/7/3/7303c2cc77de8844a90dc5c4cd6d1103b74db774.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:** [April 4, 2022, 12:35am UTC](https://discuss.elastic.co/t/jvm-heap-size-arguments/301343/2 "2022-04-04T00:35:05Z")

</div>

Welcome to our community! 😃 We aren't all guys though.

Also please don't post pictures of text, logs or code. They are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them 🙂

> [@Leo\_Collette](#):
>
> in my system we adopted a pattern of adjusting the heap size parameter to 1G, but over time the service ends up consuming more than this value, is this ok or not?

If you define a heap setting then Elasticsearch will stick to that. If you are seeing more memory usage attached to the process then that's system managed memory, not Elasticsearch.

> [@Leo\_Collette](#):
>
> does adjusting a limit for the heap size have any risk of problems? index corruption or something?

If you go very small Elasticsearch probably won't run. If you go very large, then GC will be a problem when it happens. Otherwise, nope.

> [@Leo\_Collette](#):
>
> other question, why Elasticsearch does so much swap? how can i disable swap in Elasticsearch? Am I at risk with this?

See [Disable swapping | Elasticsearch Guide [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/setup-configuration-memory.html)

---

<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 2, 2022, 12:36am UTC](https://discuss.elastic.co/t/jvm-heap-size-arguments/301343/3 "2022-05-02T00:36:03Z")

</div>

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