github-actions[bot] commented on code in PR #42418:
URL: https://github.com/apache/doris/pull/42418#discussion_r1814761892
##########
be/src/runtime/workload_group/workload_group.cpp:
##########
@@ -255,6 +250,91 @@ void
WorkloadGroup::add_mem_tracker_limiter(std::shared_ptr<MemTrackerLimiter> m
_mem_tracker_limiter_pool[group_num].trackers.end(),
mem_tracker_ptr);
}
+int64_t WorkloadGroup::free_overcommited_memory(int64_t need_free_mem,
RuntimeProfile* profile) {
Review Comment:
warning: function 'free_overcommited_memory' exceeds recommended
size/complexity thresholds [readability-function-size]
```cpp
int64_t WorkloadGroup::free_overcommited_memory(int64_t need_free_mem,
RuntimeProfile* profile) {
^
```
<details>
<summary>Additional context</summary>
**be/src/runtime/workload_group/workload_group.cpp:252:** 83 lines including
whitespace and comments (threshold 80)
```cpp
int64_t WorkloadGroup::free_overcommited_memory(int64_t need_free_mem,
RuntimeProfile* profile) {
^
```
</details>
##########
be/src/runtime/workload_group/workload_group.cpp:
##########
@@ -115,21 +113,18 @@ std::string WorkloadGroup::debug_string() const {
}
bool WorkloadGroup::add_wg_refresh_interval_memory_growth(int64_t size) {
- // If a group is enable memory overcommit, then not need check the limit
- // It is always true, and it will only fail when process memory is not
- // enough.
- if (_enable_memory_overcommit) {
- if (doris::GlobalMemoryArbitrator::is_exceed_soft_mem_limit(size)) {
- return false;
- } else {
- return true;
- }
- }
auto realtime_total_mem_used =
_total_mem_used + _wg_refresh_interval_memory_growth.load() + size;
if ((realtime_total_mem_used >
((double)_memory_limit *
_spill_high_watermark.load(std::memory_order_relaxed) / 100))) {
- return false;
+ // If a group is enable memory overcommit, then not need check the
limit
+ // It is always true, and it will only fail when process memory is not
+ // enough.
+ if (_enable_memory_overcommit) {
+ return true;
Review Comment:
warning: redundant boolean literal in conditional return statement
[readability-simplify-boolean-expr]
be/src/runtime/workload_group/workload_group.cpp:122:
```diff
- if (_enable_memory_overcommit) {
- return true;
- } else {
- return false;
- }
+ return _enable_memory_overcommit;
```
##########
be/src/runtime/workload_group/workload_group.h:
##########
@@ -211,11 +197,9 @@ class WorkloadGroup : public
std::enable_shared_from_this<WorkloadGroup> {
}
int64_t get_remote_scan_bytes_per_second();
- int64_t load_buffer_limit() { return _load_buffer_limit; }
+ int64_t load_buffer_limit() const { return _memory_limit *
_load_buffer_ratio / 100; }
Review Comment:
warning: method 'load_buffer_limit' can be made const
[readability-make-member-function-const]
```suggestion
int64_t load_buffer_limit() const { return _memory_limit *
_load_buffer_ratio / 100; }
```
##########
be/src/runtime/workload_group/workload_group_manager.cpp:
##########
@@ -595,21 +641,15 @@ bool
WorkloadGroupMgr::handle_single_query(std::shared_ptr<QueryContext> query_c
return true;
}
-void WorkloadGroupMgr::update_queries_limit(WorkloadGroupPtr wg, bool
enable_hard_limit) {
+void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool
enable_hard_limit) {
Review Comment:
warning: function 'update_queries_limit_' exceeds recommended
size/complexity thresholds [readability-function-size]
```cpp
void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool
enable_hard_limit) {
^
```
<details>
<summary>Additional context</summary>
**be/src/runtime/workload_group/workload_group_manager.cpp:643:** 91 lines
including whitespace and comments (threshold 80)
```cpp
void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool
enable_hard_limit) {
^
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]