-
Notifications
You must be signed in to change notification settings - Fork 747
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
builder | ||
.enable_all() | ||
.on_thread_stop(rt_tracker.on_stop_thread()) | ||
.on_thread_start(rt_tracker.on_start_thread()); | ||
.on_thread_stop(|| { ThreadTracker::destroy(); }) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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; |
There was a problem hiding this comment.
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) | ||
} | ||
} |
There was a problem hiding this comment.
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?
Feel free to open it again ❤️ |
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