Skip to content

Commit

Permalink
4
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed May 18, 2024
1 parent eaf347c commit fecbe32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions be/src/runtime/memory/mem_tracker_limiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,12 @@ class MemTrackerLimiter final : public MemTracker {
int64_t limit() const { return _limit; }
bool limit_exceeded() const { return _limit >= 0 && _limit < consumption(); }

bool try_consume(int64_t bytes, bool force_tracker_overcommit = false) const {
bool try_consume(int64_t bytes) const {
if (UNLIKELY(bytes == 0)) {
return true;
}
bool st = true;
if (force_tracker_overcommit ||
(is_overcommit_tracker() && config::enable_query_memory_overcommit)) {
if (is_overcommit_tracker() && config::enable_query_memory_overcommit) {
st = _consumption->try_add(bytes, _limit);
} else {
_consumption->add(bytes);
Expand Down
6 changes: 3 additions & 3 deletions be/src/runtime/memory/thread_mem_tracker_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ThreadMemTrackerMgr {
void consume(int64_t size, int skip_large_memory_check = 0);
void flush_untracked_mem();

bool try_reserve(int64_t size, bool force_tracker_overcommit);
bool try_reserve(int64_t size);
void release_reserved();

bool is_attach_query() { return _query_id != TUniqueId(); }
Expand Down Expand Up @@ -255,7 +255,7 @@ inline void ThreadMemTrackerMgr::flush_untracked_mem() {
_stop_consume = false;
}

inline bool ThreadMemTrackerMgr::try_reserve(int64_t size, bool force_tracker_overcommit) {
inline bool ThreadMemTrackerMgr::try_reserve(int64_t size) {
DCHECK(_limiter_tracker_raw);
DCHECK(size >= 0);
CHECK(init());
Expand All @@ -264,7 +264,7 @@ inline bool ThreadMemTrackerMgr::try_reserve(int64_t size, bool force_tracker_ov
if (_reserved_mem != 0) { // not expected
release_reserved();
}
if (!_limiter_tracker_raw->try_consume(size, force_tracker_overcommit)) {
if (!_limiter_tracker_raw->try_consume(size)) {
return false;
}
if (!doris::GlobalMemoryArbitrator::try_reserve_process_memory(size)) {
Expand Down
4 changes: 2 additions & 2 deletions be/src/runtime/thread_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ class ThreadContext {
thread_mem_tracker_mgr->consume(size, skip_large_memory_check);
}

bool try_reserve_memory(const int64_t size, bool force_tracker_overcommit) const {
bool try_reserve_memory(const int64_t size) const {
#ifdef USE_MEM_TRACKER
DCHECK(doris::k_doris_exit || !doris::config::enable_memory_orphan_check ||
thread_mem_tracker()->label() != "Orphan")
<< doris::memory_orphan_check_msg;
#endif
return thread_mem_tracker_mgr->try_reserve(size, force_tracker_overcommit);
return thread_mem_tracker_mgr->try_reserve(size);
}

void release_reserved_memory() const {
Expand Down

0 comments on commit fecbe32

Please sign in to comment.