Skip to content

Conversation

@kazuyukitanimura
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

DataFusion has an unbounded memory pool. I found it useful for experimental purpose.

What changes are included in this PR?

Added an option for unbounded memory pool.

How are these changes tested?

existing tests

@kazuyukitanimura kazuyukitanimura marked this pull request as ready for review February 11, 2025 06:51
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.06%. Comparing base (f09f8af) to head (d9c9b03).
⚠️ Report is 433 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #1386       +/-   ##
=============================================
- Coverage     56.12%   39.06%   -17.06%     
- Complexity      976     2071     +1095     
=============================================
  Files           119      263      +144     
  Lines         11743    60746    +49003     
  Branches       2251    12909    +10658     
=============================================
+ Hits           6591    23733    +17142     
- Misses         4012    32530    +28518     
- Partials       1140     4483     +3343     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"greedy_global" => MemoryPoolConfig::new(MemoryPoolType::GreedyGlobal, pool_size),
"fair_spill" => MemoryPoolConfig::new(MemoryPoolType::FairSpill, pool_size_per_task),
"greedy" => MemoryPoolConfig::new(MemoryPoolType::Greedy, pool_size_per_task),
"unbounded" => MemoryPoolConfig::new(MemoryPoolType::Unbounded, 0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I don't know if it is ever a good idea to allow an unbounded memory pool. It doesn't hurt to have the option, but under what conditions is this choice useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the unbounded memory pool is useful for the cases we do not want to allow any spilling and rather choose to fail the job. Spilling slows down the job a lot and the unbounded memory pool is one way to measure the best case without adjusting how much memory we provide for native exec

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can add this advice in the documentation. Speeding up the job sounds like a win until the jobs start OOMing. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the value in having the unbounded tool for development testing purposes but not for end user use.

I would like to use it to help with #1315

"Available memory pool types are 'greedy', 'fair_spill', 'greedy_task_shared', " +
"'fair_spill_task_shared', 'greedy_global' and 'fair_spill_global'. For off-heap " +
"types are 'unified' and `fair_unified`.")
"'fair_spill_task_shared', 'greedy_global', 'fair_spill_global', and `unbounded`. " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point there are so many options for memory pool that it is bound to confuse users. Would it be a good idea to have a bit of documentation that helps users decide what kind of memory pool to use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I also do not know some of the differences like 'fair_spill_task_shared' vs 'greedy_global'
I filed an issue #1388 and will on separately

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I can add the doc to the place

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for development/testing purposes. Thanks @kazuyukitanimura.

@kazuyukitanimura kazuyukitanimura merged commit 4fe4f57 into apache:main Feb 12, 2025
75 checks passed
@kazuyukitanimura
Copy link
Contributor Author

Merged, thanks @parthchandra @andygrove

kazuyukitanimura added a commit that referenced this pull request Feb 13, 2025
## Which issue does this PR close?

Closes #1388 

## Rationale for this change

Following up on #1369 and #1386 

## What changes are included in this PR?

Updated the doc

## How are these changes tested?
coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
## Which issue does this PR close?

## Rationale for this change

DataFusion has an unbounded memory pool. I found it useful for experimental purpose.

## What changes are included in this PR?

Added an option for unbounded memory pool.

## How are these changes tested?

existing tests
coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
## Which issue does this PR close?

Closes apache#1388 

## Rationale for this change

Following up on apache#1369 and apache#1386 

## What changes are included in this PR?

Updated the doc

## How are these changes tested?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants