Outofmemory exception in elasticsearch


i am running elasticsearch as a part of application arcitecture, we have elasticsearch running in 3 identical machine, sometimes we see outofmemory exception and all it gets terminated in all the 3 machines.

below is the exception:
[o.e.b.ElasticsearchUncaughtExceptionHandler] [data-node-1] fatal error in thread [elasticsearch[data-node-1][warmer][T#2]], exiting java.lang.OutOfMemoryError: Java heap space

can someone please help here

Welcome !

What is the output of:

GET /_cat/nodes?v
GET /_cat/health?v
GET /_cat/indices?v

Also what are the logs of your elasticsearch server?

If some outputs are too big, please share them on gist.github.com and link them here.