Propagating Elasticsearch exceptions to Elasticsearch.Nest client

I am new to Elasticsearch and I've run into OOM exception several times
during bulk indexing. Since then I've taken measures like increasing heap
size and throttling bulk indexing rate but I would like to reliably know
when Java runs out of memory and how to recover from that situation.
Elasticsearch logs the OOM errors to a log file but I could not find an
easy way to get the client to know about it.


  1. What is the best place to handle Elasticsearch OOM exceptions - Client
    or Server?
  2. Once it runs out of memory and gets detected reliably, what is the best
    way to revive Elasticsearch without data loss?

I am using Elasticsearch.Nest client to talk to Elasticsearch. I am open to
using other clients too if it helps my cause.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit