-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Memory] Add a method to get doris current memory usage and Limt memoey usage when consume #6979
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
Conversation
abc2ab2 to
43a0fbc
Compare
d145241 to
39781c6
Compare
|
lgtm % add tests for |
bec85ac to
6e8b55d
Compare
dc24a76 to
cf12d58
Compare
| #if !defined(ADDRESS_SANITIZER) && !defined(LEAK_SANITIZER) && !defined(THREAD_SANITIZER) | ||
| doris::MemInfo::refresh_current_mem(); | ||
| #endif | ||
| sleep(10); |
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.
10ms
| if (MemInfo::current_mem() + bytes >= MemInfo::mem_limit()) { | ||
| return Status::MemoryLimitExceeded(fmt::format( | ||
| "{}: TryConsume failed, bytes={} process whole consumption={} mem limit={}", | ||
| label_, bytes, MemInfo::current_mem(), MemInfo::mem_limit())); |
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.
Status::MemoryLimitExceeded not MemTracker::MemLimitExceeded
Add all memory usage check when TryConsume memory
cf12d58 to
0a154d4
Compare
morningman
left a comment
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.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
Proposed changes
Add a method to get Doris current memory usage, get Doris memory usage every 1 second.
This method used to limit the whole memory allocation in Doris
Add all memory usage check when
TryConsumememoryTypes of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...