diff --git a/be/src/cloud/cloud_storage_engine.cpp b/be/src/cloud/cloud_storage_engine.cpp index de4bbac7b3ef6c..8062631af1fc29 100644 --- a/be/src/cloud/cloud_storage_engine.cpp +++ b/be/src/cloud/cloud_storage_engine.cpp @@ -48,6 +48,7 @@ #include "olap/memtable_flush_executor.h" #include "olap/storage_policy.h" #include "runtime/memory/cache_manager.h" +#include "util/parse_util.h" namespace doris { @@ -186,8 +187,15 @@ Status CloudStorageEngine::open() { _calc_delete_bitmap_executor = std::make_unique(); _calc_delete_bitmap_executor->init(); - _txn_delete_bitmap_cache = - std::make_unique(config::delete_bitmap_agg_cache_capacity); + // The default cache is set to 100MB, use memory limit to dynamic adjustment + bool is_percent = false; + int64_t delete_bitmap_agg_cache_cache_limit = + ParseUtil::parse_mem_spec(config::delete_bitmap_dynamic_agg_cache_limit, + MemInfo::mem_limit(), MemInfo::physical_mem(), &is_percent); + _txn_delete_bitmap_cache = std::make_unique( + delete_bitmap_agg_cache_cache_limit > config::delete_bitmap_agg_cache_capacity + ? delete_bitmap_agg_cache_cache_limit + : config::delete_bitmap_agg_cache_capacity); RETURN_IF_ERROR(_txn_delete_bitmap_cache->init()); _file_cache_block_downloader = std::make_unique(*this);