Skip to content

Improve Memory Accounting and Stability in FetchPhase and Multi-Search #139132

@jimczi

Description

@jimczi

The current memory handling in the fetch phase and during multi-search accumulation does not fully utilize the reference-counted lifecycle of SearchHit.
As a result, memory used by hits is not consistently tracked by the request circuit breaker, and large fetch results or large multi-search responses can accumulate without proper accounting.

Additionally, the fetch phase still returns results as a single large payload rather than chunking, which increases peak memory usage and limits Elasticsearch’s ability to protect itself from large responses.

This issue tracks the core changes needed to improve stability and ensure predictable, safe memory behavior in fetch and multi-search operations:

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search Foundations/SearchCatch all for Search Foundations>enhancementSupportabilityImprove our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better.Team:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions