提交 b1c0fe05 编写于 作者: O obdev 提交者: wangzelin.wzl

Fix OOM bug that SegmentBitset allocate more than the 2M size

上级 94816acd
......@@ -531,7 +531,7 @@ int Ob2DArray<T, max_block_size, BlockAllocatorT, auto_free, BlockPointerArrayT>
const int64_t current_blocks = get_block_count();
for (int64_t i = current_blocks; OB_SUCC(ret) && i < need_blocks; ++i) {
if (OB_FAIL(new_block())) {
LIB_LOG(WARN, "failed: new_block()", K(ret));
LIB_LOG(WARN, "failed: new_block()", K(ret), K(need_blocks), K(capacity));
}
}
}
......
......@@ -442,7 +442,7 @@ public:
}
private:
ObSegmentBitSet<> bits_;
ObSegmentBitSet<common::OB_MALLOC_BIG_BLOCK_SIZE> bits_;
int64_t cnt_; // power of 2
int64_t h2_shift_;
};
......
......@@ -824,7 +824,10 @@ int ObTenantSqlMemoryManager::get_max_work_area_size(int64_t& max_wa_memory_size
if (OB_FAIL(ObResourceMgr::get_instance().get_tenant_resource_mgr(tenant_id_, resource_handle))) {
ret = OB_SUCCESS;
} else {
max_tenant_memory_size += resource_handle.get_memory_mgr()->get_cache_hold();
// TODO: kvcache大概可以淘汰多少内存,目前没有数据,后续寒晖他们会提供接口
// bug34818894 https://work.aone.alibaba-inc.com/issue/34818894
// 这里暂时写一个默认比例
max_tenant_memory_size += resource_handle.get_memory_mgr()->get_cache_hold() * 0.05;
}
}
int64_t remain_memory_size =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册