[CP] [FEAT MERGE] SQL MEMLEAK

This commit is contained in:
tushicheng
2024-03-15 03:20:51 +00:00
committed by ob-robot
parent 0487d20e6d
commit 9177cab121
38 changed files with 395 additions and 89 deletions

View File

@ -151,6 +151,7 @@ int ObDtlChannelLoop::ObDtlChannelLoopProc::process(
const ObDtlLinkedBuffer &buffer, bool &transferred)
{
int ret = OB_SUCCESS;
DISABLE_SQL_MEMLEAK_GUARD;
ObDtlMsgHeader header;
if (buffer.is_data_msg()) {
last_msg_type_ = static_cast<int16_t>(ObDtlMsgType::PX_NEW_ROW);

View File

@ -203,6 +203,7 @@ int ObDTLIntermResultManager::create_interm_result_info(ObMemAttr &attr,
int ret = OB_SUCCESS;
void *result_info_buf = NULL;
void *store_buf = NULL;
SET_IGNORE_MEM_VERSION(attr);
const int64_t store_size = use_rich_format ? sizeof(ObTempColumnStore) : sizeof(ObChunkDatumStore);
if (OB_ISNULL(result_info_buf = ob_malloc(sizeof(ObDTLIntermResultInfo), attr))) {
ret = OB_ALLOCATE_MEMORY_FAILED;

View File

@ -47,7 +47,11 @@ public:
class ObSequenceExecutor {
public:
ObSequenceExecutor()
:dblink_id_(OB_INVALID_ID) {}
: dblink_id_(OB_INVALID_ID)
{
seq_schemas_.set_attr(SET_IGNORE_MEM_VERSION("SeqSchema"));
seq_ids_.set_attr(SET_IGNORE_MEM_VERSION("SeqId"));
}
~ObSequenceExecutor() { destroy(); }
virtual int init(ObExecContext &ctx)=0;
virtual void reset() { seq_ids_.reset(); seq_schemas_.reset();}

View File

@ -387,8 +387,9 @@ OB_INLINE int ObTableScanOp::reuse_table_rescan_allocator()
if (OB_ISNULL(table_rescan_allocator_)) {
ObSQLSessionInfo *my_session = GET_MY_SESSION(ctx_);
lib::ContextParam param;
param.set_mem_attr(my_session->get_effective_tenant_id(),
"TableRescanCtx", ObCtxIds::DEFAULT_CTX_ID)
ObMemAttr attr(my_session->get_effective_tenant_id(),
"TableRescanCtx", ObCtxIds::DEFAULT_CTX_ID);
param.set_mem_attr(SET_IGNORE_MEM_VERSION(attr))
.set_properties(lib::USE_TL_PAGE_OPTIONAL)
.set_ablock_size(lib::INTACT_MIDDLE_AOBJECT_SIZE);
lib::MemoryContext mem_context;

View File

@ -130,6 +130,7 @@ int ObMaintainObjDepInfoTask::check_and_build_dep_info_arg(
share::ObAsyncTask *ObMaintainObjDepInfoTask::deep_copy(char *buf, const int64_t buf_size) const
{
int ret = OB_SUCCESS;
DISABLE_SQL_MEMLEAK_GUARD;
ObAsyncTask *task = nullptr;
const int64_t need_size = get_deep_copy_size();
if (OB_ISNULL(buf)) {

View File

@ -262,6 +262,7 @@ int ObSqlTransControl::end_trans(ObExecContext &exec_ctx,
{
int ret = OB_SUCCESS;
bool sync = false;
DISABLE_SQL_MEMLEAK_GUARD;
ObSQLSessionInfo *session = GET_MY_SESSION(exec_ctx);
ObPhysicalPlanCtx *plan_ctx = GET_PHY_PLAN_CTX(exec_ctx);
#ifndef NDEBUG
@ -525,6 +526,7 @@ int ObSqlTransControl::decide_trans_read_interface_specs(
int ObSqlTransControl::start_stmt(ObExecContext &exec_ctx)
{
int ret = OB_SUCCESS;
DISABLE_SQL_MEMLEAK_GUARD;
ObSQLSessionInfo *session = GET_MY_SESSION(exec_ctx);
ObPhysicalPlanCtx *plan_ctx = GET_PHY_PLAN_CTX(exec_ctx);
const ObPhysicalPlan *plan = plan_ctx->get_phy_plan();
@ -1042,6 +1044,7 @@ int ObSqlTransControl::xa_rollback_all_changes(ObExecContext &exec_ctx)
int ObSqlTransControl::end_stmt(ObExecContext &exec_ctx, const bool rollback)
{
int ret = OB_SUCCESS;
DISABLE_SQL_MEMLEAK_GUARD;
ObSQLSessionInfo *session = GET_MY_SESSION(exec_ctx);
auto *plan_ctx = GET_PHY_PLAN_CTX(exec_ctx);
const ObPhysicalPlan *plan = NULL;