Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(base): supports memory usage limits. #7290

Closed
wants to merge 1 commit into from

Conversation

zhang2014
Copy link
Member

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

feature(base): supports memory usage limits.

fixes #7271

@vercel
Copy link

vercel bot commented Aug 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Aug 25, 2022 at 4:42AM (UTC)

builder
.enable_all()
.on_thread_stop(rt_tracker.on_stop_thread())
.on_thread_start(rt_tracker.on_start_thread());
.on_thread_stop(|| { ThreadTracker::destroy(); })
Copy link
Member

Choose a reason for hiding this comment

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

For better understanding, how about:

.on_thread_start(xxx)
.on_thread_stop(xxx)

@@ -0,0 +1,216 @@
// Copyright 2021 Datafuse Labs.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2021 Datafuse Labs.
// Copyright 2022 Datafuse Labs.


#[inline]
pub fn realloc_memory(old_size: i64, new_size: i64) {
let addition = new_size - old_size;
Copy link
Member

Choose a reason for hiding this comment

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

What's different between new_size > old_size?

self.memory_usage.load(Ordering::Relaxed)
+ UNTRACKED_MEMORY_LIMIT * self.total_thread_size.load(Ordering::Relaxed)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a unit test for this mod?

@zhang2014 zhang2014 mentioned this pull request Aug 30, 2022
2 tasks
@BohuTANG BohuTANG mentioned this pull request Aug 30, 2022
43 tasks
@Xuanwo
Copy link
Member

Xuanwo commented Dec 1, 2022

Feel free to open it again ❤️

@Xuanwo Xuanwo closed this Dec 1, 2022
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.

Feature: introduce buffer pool(aka memory manager) to avoid OOM for some opeartors
2 participants