# Circuit Breaker not stopping my search query even though my heap size crosses

**URL:** <https://discuss.elastic.co/t/circuit-breaker-not-stopping-my-search-query-even-though-my-heap-size-crosses/165353>\
**Category:** Elasticsearch\
**Created:** [January 23, 2019, 7:57am UTC](https://discuss.elastic.co/t/circuit-breaker-not-stopping-my-search-query-even-though-my-heap-size-crosses/165353 "2019-01-23T07:57:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikesh/32/86579_2.png) [@Nikesh](https://discuss.elastic.co/u/Nikesh)\
**Post date:** [January 23, 2019, 7:57am UTC](https://discuss.elastic.co/t/circuit-breaker-not-stopping-my-search-query-even-though-my-heap-size-crosses/165353/1 "2019-01-23T07:57:23Z")

</div>

Hi,

I am trying to understand the working of circuit breaker.  
I see the default value of "parent-level breaker" is 70% of JVM Heap.  
I have set "in flight requests circuit breaker" and "accounting circuit breaker " to 70% of heap.

When I run a query with multiple occurences of wildcards, I see Heap size exceeding the maximum available and cluster reaches red status.  
According to my understanding, once the Heap crosses 70%, Circuit Breaker must prevent OOM error.  
But I don't see this happening

Is my understanding correct or am I missing something here?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 23, 2019, 9:33am UTC](https://discuss.elastic.co/t/circuit-breaker-not-stopping-my-search-query-even-though-my-heap-size-crosses/165353/2 "2019-01-23T09:33:54Z")

</div>

Circuit breakers are a "best effort" protection against a node running out of memory, rather than a guarantee. In released versions the circuit breakers track a number of known memory consumers, but they do not track everything and it is certainly possible to consume too much untracked memory as you seem to be doing.

This changes in 7.0 with the introduction of a real-memory circuit breaker, linked below. Circuit breakers remain a "best effort" protection, but this change improves their accuracy.

> <https://github.com/elastic/elasticsearch/pull/31767>

---

<div class="post-metadata">

**Author:** ![Nikesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikesh/32/86579_2.png) [@Nikesh](https://discuss.elastic.co/u/Nikesh)\
**Post date:** [January 23, 2019, 1:23pm UTC](https://discuss.elastic.co/t/circuit-breaker-not-stopping-my-search-query-even-though-my-heap-size-crosses/165353/3 "2019-01-23T13:23:31Z")

</div>

Thanks David for your quick response.

---

<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:** [February 20, 2019, 1:32pm UTC](https://discuss.elastic.co/t/circuit-breaker-not-stopping-my-search-query-even-though-my-heap-size-crosses/165353/4 "2019-02-20T13:32:28Z")

</div>

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