# Can't set JVM Cheap memory setting

**URL:** <https://discuss.elastic.co/t/cant-set-jvm-cheap-memory-setting/380957>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 12, 2025, 7:56am UTC](https://discuss.elastic.co/t/cant-set-jvm-cheap-memory-setting/380957 "2025-08-12T07:56:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheJ](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@TheJ](https://discuss.elastic.co/u/TheJ)\
**Post date:** [August 12, 2025, 7:56am UTC](https://discuss.elastic.co/t/cant-set-jvm-cheap-memory-setting/380957/1 "2025-08-12T07:56:05Z")

</div>

Hi,

I have a circuit\_breaking\_exception error in my cluster. When I look into logs I see that nodes need 32gb JVM memory to load indices.

```auto
[parent] Data too large, data for [indices:data/read/search[phase/query]] would be [31996760742/29.7gb], which is larger than the limit of [31621696716/29.4gb], real usage: [31996748928/29.7gb], new bytes reserved: [11814/11.5kb], usages [fielddata=0/0b, request=0/0b, inflight_requests=13994/13.6kb, model_inference=0/0b, eql_sequence=0/0b]

```

So I add `ES_JAVA_OPTS=-Xms32g -Xmx32g` environment variable to my containers via `docker service update --env-add "ES_JAVA_OPTS=-Xms32g -Xmx32g" elastic_node1`. But in logs I see that elasticsearch set this memory to only 30.6gb.

I think this value should be equal to 32gb. Somebody know why this happening ?

Thanks for help.

PS. I running elasticsearch nodes as a docker services

---

<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:** [August 12, 2025, 8:53am UTC](https://discuss.elastic.co/t/cant-set-jvm-cheap-memory-setting/380957/2 "2025-08-12T08:53:14Z")

</div>

I would recommend reading [this blog post](https://www.elastic.co/blog/a-heap-of-trouble) on the topic. It explains why it is important to set the heap size below 32GB in order to benefit from compressed pointers.

Which version of Elasticsearch are you using?

What is the size of the cluster? How much data does it hold? What load is it under?
