The bytes from the _source field and highlighting returned during the FETCH phase should be included in the request circuit breaker.
I think there are several things to think about:
Overall I am a bit concerned such a feature would be very hard to implement correctly while addressing #9311 would already solve most problems.
@jpountz I think this should use our request circuit breaker mechanism, that already works well in the context of aggs (in terms of releasing it at the correct search execution phase) and is "global". My thought was simply to add to the circuit breaker once each document is loaded. This will also help to take into account a more bigger notion of memory usage, basically anything the request circuit breaker encapsulates.
@danielmitterdorfer does the inflight request circuit breaker handle this situation already?
@clintongormley No, the inflight-request circuit breaker tracks only bytes for request processing (see TcpTransport#handleRequest()). Bytes allocated for responses are not counted.