Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Jul 30, 2024
1 parent 764eb3b commit 2e5ac71
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ DEFINE_mString(process_full_gc_size, "20%");
// If false, cancel query when the memory used exceeds exec_mem_limit, same as before.
DEFINE_mBool(enable_query_memory_overcommit, "true");

DEFINE_mBool(enable_memory_reclamation, "true");
DEFINE_mBool(disable_memory_gc, "false");

DEFINE_mBool(enable_stacktrace, "true");

Expand Down
7 changes: 3 additions & 4 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,9 @@ DECLARE_mString(process_full_gc_size);
// If false, cancel query when the memory used exceeds exec_mem_limit, same as before.
DECLARE_mBool(enable_query_memory_overcommit);

// memory reclamation will release cache, cancel task, and task will wait for gc to release memory,
// default reclamation strategy is conservative,
// if you want to exclude the interference of memory reclamation, let it be false
DECLARE_mBool(enable_memory_reclamation);
// gc will release cache, cancel task, and task will wait for gc to release memory,
// default gc strategy is conservative, if you want to exclude the interference of gc, let it be true
DECLARE_mBool(disable_memory_gc);

// if false, turn off all stacktrace
DECLARE_mBool(enable_stacktrace);
Expand Down
6 changes: 3 additions & 3 deletions be/src/common/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void Daemon::memory_gc_thread() {
int32_t memory_gc_sleep_time_ms = config::memory_gc_sleep_time_ms;
while (!_stop_background_threads_latch.wait_for(
std::chrono::milliseconds(interval_milliseconds))) {
if (!config::enable_memory_reclamation) {
if (config::disable_memory_gc) {
continue;
}
auto sys_mem_available = doris::GlobalMemoryArbitrator::sys_mem_available();
Expand Down Expand Up @@ -387,7 +387,7 @@ void Daemon::je_purge_dirty_pages_thread() const {
if (_stop_background_threads_latch.count() == 0) {
break;
}
if (!config::enable_memory_reclamation) {
if (config::disable_memory_gc) {
continue;
}
doris::MemInfo::je_purge_all_arena_dirty_pages();
Expand All @@ -403,7 +403,7 @@ void Daemon::cache_prune_stale_thread() {
<< "], force set to 3600 ";
interval = 3600;
}
if (!config::enable_memory_reclamation) {
if (config::disable_memory_gc) {
continue;
}
CacheManager::instance()->for_each_cache_prune_stale();
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/common/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator>::sys_mem
print_id(doris::thread_context()->task_id()),
doris::thread_context()->get_thread_id(),
doris::config::thread_wait_gc_max_milliseconds, err_msg);
if (doris::config::enable_memory_reclamation) {
if (!doris::config::disable_memory_gc) {
while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) {
Expand Down

0 comments on commit 2e5ac71

Please sign in to comment.