apache / apache/datafusion

Add a fine grain memory usage tracking / break down of memory usage *within* each operator

Open
#16,904 19 comments 1 reaction 1 assignee Claimed by @kosiew View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

Yes, debugging memory problems are hard, when running DF in production and the memory pool is unable to grow the memory it will return `ResourcesExhausted` error or panic depending on the memory pool implementation, however we don't know what takes all the memory.

In my case I had to manually patch DataFusion `row_hash` file to print on error what every accumulator takes and the internals

### Describe the solution you'd like

I want to add new API - that has `size` function (not required just because I think it should be combined with `explain_memory`) and `explain_memory` function or something (similar to `Debug` trait) to get string with breakdown of the size with every thing that takes memory.

So for `GroupedHashAggregateStream` it would say how much group values takes, and for each accumulators it would call the explain memory on each

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.