The BigArrays class (which is used by a lot of aggregations) allocates the new array pages when growing the array before it calls the circuit breaker. This means that if the amount of memory required for the grow operation exceeds the available heap we will throw an OOME instead of tripping the circuit breaker.
This issue was identified whilst investigating #15892
The fix is to estimate the amount of memory required by big arrays (should be able to estimate within 16KB) and then use this with the circuit breaker before we allocate the arrays.
The BigArrays class (which is used by a lot of aggregations) allocates the new array pages when growing the array before it calls the circuit breaker. This means that if the amount of memory required for the grow operation exceeds the available heap we will throw an OOME instead of tripping the circuit breaker.
This issue was identified whilst investigating #15892
The fix is to estimate the amount of memory required by big arrays (should be able to estimate within 16KB) and then use this with the circuit breaker before we allocate the arrays.