diagnose memory bloat

This commit is contained in:
tushicheng
2024-04-15 03:20:56 +00:00
committed by ob-robot
parent 8b461d5c8b
commit 4bb2e95295
12 changed files with 101 additions and 58 deletions

View File

@ -1464,7 +1464,6 @@ int ObTenantFreezer::print_tenant_usage(
{
int ret = OB_SUCCESS;
ObTenantStatistic stat;
lib::ObMallocAllocator *mallocator = lib::ObMallocAllocator::get_instance();
if (!is_inited_) {
ret = OB_NOT_INIT;
@ -1502,11 +1501,6 @@ int ObTenantFreezer::print_tenant_usage(
stat.memstore_reclaimed_pos_);
}
if (!OB_ISNULL(mallocator)) {
mallocator->print_tenant_memory_usage(tenant_info_.tenant_id_);
mallocator->print_tenant_ctx_memory_usage(tenant_info_.tenant_id_);
}
return ret;
}

View File

@ -90,26 +90,6 @@ int ObTenantMemoryPrinter::print_tenant_usage()
LOG_WARN("print mtl tenant usage failed", K(tmp_ret), K(tenant_id));
}
}
int tenant_cnt = 0;
static uint64_t all_tenant_ids[OB_MAX_SERVER_TENANT_CNT] = {0};
common::get_tenant_ids(all_tenant_ids, OB_MAX_SERVER_TENANT_CNT, tenant_cnt);
lib::ObMallocAllocator *mallocator = lib::ObMallocAllocator::get_instance();
for (int64_t i = 0; OB_SUCC(ret) && i < tenant_cnt; ++i) {
uint64_t id = all_tenant_ids[i];
if (!is_virtual_tenant_id(id)) {
bool is_deleted_tenant = true;
for (int j = 0; j < mtl_tenant_ids.count(); ++j) {
if (id == mtl_tenant_ids[j]) {
is_deleted_tenant = false;
break;
}
}
if (is_deleted_tenant) {
mallocator->print_tenant_memory_usage(id);
mallocator->print_tenant_ctx_memory_usage(id);
}
}
}
}
if (OB_SIZE_OVERFLOW == ret) {