Skip to content

Find a solution to prevent processes being OOM killed due to inaccurate memory accounting #25650

Description

@andygrove

Is your feature request related to a problem or challenge?

DataFusion's memory accounting isn't accurate. When a process runs in a container (e.g. on k8s) and allocates more memory than is available, it gets OOM killed. This hits downstream projects like Comet: https://datafusion.apache.org/comet/contributor-guide/memory_management.html

Let's use this issue to discuss approaches.

Describe the solution you'd like

One idea is to hook into the actual allocator (e.g. jemalloc) so we can see real allocated bytes, and then:

  • log actual usage next to the memory pool's reported usage, so we can at least see where they drift
  • add a memory pool that rejects allocations once real allocated bytes go over a limit

We could also work on improving the estimated memory usage in various operators and expressions.

Additional context

Activity

  1. comphead commented on Sep 23, 2026

    @comphead
    Contributor

    Related to #23393

  2. self-assigned this
    on Sep 23, 2026
  3. 2010YOUY01 commented on Sep 24, 2026

    @2010YOUY01
    Contributor

    The existing way for memory validation is:

    If there are any better alternative, we could unify it with the above approach and avoid maintaining two parallel testing suites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions