JVM Heap size issue. ElasticSearch stops sometimes due to this error

Caused by: org.elasticsearch.common.breaker.CircuitBreakingException: [parent] Data too large, data for [preallocate[aggregations]] would be [4143070784/3.8gb], which is larger than the limit of [4080218931/3.7gb], real usage: [4143064640/3.8gb],

Hello, there is a total of 1 node in the cluster. 1 master node only.
The master node has 64 GB ram. But the JVM heap is set to 4 GB.

-Xms4g
-Xmx4g

guide me on what should I do...

Increase the size of the heap. Go to 8GB and see how that works out.

Hi @Christian_Dahlqvist

I've read the alternatives like you said but can you please tell me what is the right way?
I tried changing it to
-Xms8g
-Xmx8g
in my local VM ELK setup but the Elastic service failed to start.

Should I change the jvm.options file and how?
Any other option for that but how?
Please guide if you know the solution

Is there anything else running on the VM? If the VM has 64GB of RAM and only hosts Elasticsearch there should be no problem.

The heap should be set to no more than 50% of the RAM available to Elasticsearch. With a 8G heap Elasticsearch requires 16GB of RAM to be available to it.

Oh yeah that's right nothing like another heavy tool running on the server having 64 GB of RAM
but what I meant earlier was that before executing these settings on my Actual ELK Server I tried it on a replica VM machine to test if it works and it failed.

So with 64 GB of RAM let's say I want to set JVM heap to 16 GB
what would be the steps I should take? what file and setting should I modify and in what manner?

You change the jvm options file, which is where I assume you got the settings you initially showed, and restart Elasticsearch.

okay so changing only the below settings like this

-Xms16g
-Xmx16g

and nothing else in the JVM options file and restarting would do the work??

Yes, that's it and set in config/jvm.options.d/jvm.options not in config/jvm.options.

So you're saying in this below location

config/jvm.options.d/jvm.options

the only thing I should write in the file is the below two lines:

-Xms16g
-Xmx16g

and nothing else
and what about jvm.options original file? any changes to be done in that file?

Yes, exactly config/jvm.options.d/jvm.options

what about jvm.options original file?
Well that should Elastic team members respond. Read the documentation.

Don't modify jvm.options since your custom settings could be overwritten by a future update of Elasticsearch (depending on the installation method)

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