fix session-based context dynamic leak
This commit is contained in:
parent
0f7e23e3f5
commit
dbedb800a4
@ -1518,7 +1518,7 @@ int ObAggregateProcessor::generate_group_row(GroupRow *&new_group_row,
|
||||
if (OB_ISNULL(cur_batch_group_buf_ = (char *)aggr_alloc_.alloc(
|
||||
alloc_size * BATCH_GROUP_SIZE))) {
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
LOG_ERROR("alloc stored row failed", K(alloc_size), K(group_id), K(ret));
|
||||
LOG_WARN("alloc stored row failed", K(alloc_size), K(group_id), K(ret));
|
||||
} else {
|
||||
// The memset is not needed here because the object will be constructed by NEW.
|
||||
// But we memset first then NEW got a better performance because of better CPU cache locality.
|
||||
|
@ -285,7 +285,6 @@ void ObSQLSessionInfo::reset(bool skip_sys_var)
|
||||
session_type_ = INVALID_TYPE;
|
||||
package_state_map_.reuse();
|
||||
sequence_currval_map_.reuse();
|
||||
contexts_map_.reuse();
|
||||
curr_session_context_size_ = 0;
|
||||
pl_context_ = NULL;
|
||||
pl_can_retry_ = true;
|
||||
@ -314,6 +313,7 @@ void ObSQLSessionInfo::reset(bool skip_sys_var)
|
||||
DESTROY_CONTEXT(mem_context_);
|
||||
mem_context_ = NULL;
|
||||
}
|
||||
contexts_map_.reuse();
|
||||
cur_exec_ctx_ = nullptr;
|
||||
plan_cache_ = NULL;
|
||||
client_app_info_.reset();
|
||||
@ -2110,6 +2110,7 @@ int ObSQLSessionInfo::clear_all_context(const ObString &context_name)
|
||||
app_ctx_info_encoder_.is_changed_ = true;
|
||||
curr_session_context_size_ -= inner_map->context_map_->size();
|
||||
inner_map->destroy();
|
||||
mem_context_->get_malloc_allocator().free(inner_map);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user