Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ CONF_String(priority_networks, "");
CONF_mInt64(tc_use_memory_min, "10737418240");
// free memory rate.[0-100]
CONF_mInt64(tc_free_memory_rate, "20");
// tcmallc aggressive_memory_decommit
CONF_mBool(tc_enable_aggressive_memory_decommit, "false");

// Bound on the total amount of bytes allocated to thread caches.
// This bound is not strict, so it is possible for the cache to go over this bound
Expand Down
8 changes: 0 additions & 8 deletions be/src/runtime/bufferpool/system_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ static int64_t HUGE_PAGE_SIZE = 2LL * 1024 * 1024;

SystemAllocator::SystemAllocator(int64_t min_buffer_len) : min_buffer_len_(min_buffer_len) {
DCHECK(BitUtil::IsPowerOf2(min_buffer_len));
#if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER) && \
!defined(USE_JEMALLOC)
// Free() assumes that aggressive decommit is enabled for TCMalloc.
size_t aggressive_decommit_enabled;
MallocExtension::instance()->GetNumericProperty("tcmalloc.aggressive_memory_decommit",
&aggressive_decommit_enabled);
CHECK_EQ(true, aggressive_decommit_enabled);
#endif
}

Status SystemAllocator::Allocate(int64_t len, BufferPool::BufferHandle* buffer) {
Expand Down
4 changes: 3 additions & 1 deletion be/src/service/doris_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ int main(int argc, char** argv) {
!defined(THREAD_SANITIZER) && !defined(USE_JEMALLOC)
// Aggressive decommit is required so that unused pages in the TCMalloc page heap are
// not backed by physical pages and do not contribute towards memory consumption.
MallocExtension::instance()->SetNumericProperty("tcmalloc.aggressive_memory_decommit", 1);
if (doris::config::tc_enable_aggressive_memory_decommit) {
MallocExtension::instance()->SetNumericProperty("tcmalloc.aggressive_memory_decommit", 1);
}
// Change the total TCMalloc thread cache size if necessary.
if (!MallocExtension::instance()->SetNumericProperty(
"tcmalloc.max_total_thread_cache_bytes",
Expand Down