[CP] check cost_time of ob_malloc

This commit is contained in:
obdev
2024-02-08 21:20:10 +00:00
committed by ob-robot
parent 8ebd6b9d09
commit a12ed0ec08
11 changed files with 220 additions and 73 deletions

View File

@ -17,6 +17,7 @@
#include <stdlib.h>
#include "lib/alloc/memory_sanity.h"
#include "lib/alloc/ob_malloc_time_monitor.h"
#include "lib/oblog/ob_log.h"
#include "lib/stat/ob_diagnose_info.h"
#include "lib/utility/utility.h"
@ -74,10 +75,9 @@ AChunk *ObTenantMemoryMgr::alloc_chunk(const int64_t size, const ObMemAttr &attr
update_cache_hold(hold_size);
}
}
ObMallocTimeMonitor::click("ALLOC_CHUNK_END");
if (!reach_ctx_limit && NULL != cache_washer_ && NULL == chunk && hold_size < cache_hold_
&& attr.label_ != ObNewModIds::OB_KVSTORE_CACHE_MB) {
common::ObTimeGuard time_guard("sync wash", 1000 * 1000);
// try wash memory from cache
ObICacheWasher::ObCacheMemBlock *washed_blocks = NULL;
bool wash_single_mb = true;
@ -151,6 +151,7 @@ AChunk *ObTenantMemoryMgr::alloc_chunk(const int64_t size, const ObMemAttr &attr
}
}
}
ObMallocTimeMonitor::click("WASH_KVCACHE_END");
}
}
return chunk;