# Propagating Elasticsearch exceptions to Elasticsearch.Nest client

**URL:** <https://discuss.elastic.co/t/propagating-elasticsearch-exceptions-to-elasticsearch-nest-client/17450>\
**Category:** Elasticsearch\
**Created:** [May 12, 2014, 4:36am UTC](https://discuss.elastic.co/t/propagating-elasticsearch-exceptions-to-elasticsearch-nest-client/17450 "2014-05-12T04:36:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsarkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bsarkar/32/42967_2.png) [@bsarkar](https://discuss.elastic.co/u/bsarkar)\
**Post date:** [May 12, 2014, 4:36am UTC](https://discuss.elastic.co/t/propagating-elasticsearch-exceptions-to-elasticsearch-nest-client/17450/1 "2014-05-12T04:36:58Z")

</div>

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.

Ask:

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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e2dd96c4-120c-40d5-b4a3-59ca1c099f1a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e2dd96c4-120c-40d5-b4a3-59ca1c099f1a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:30am UTC](https://discuss.elastic.co/t/propagating-elasticsearch-exceptions-to-elasticsearch-nest-client/17450/2 "2017-07-06T01:30:15Z")

</div>

Closed on July 6, 2017, 1:30am UTC


