Fix inaccurate object_set's hold_bytes metric
This commit is contained in:
6
deps/oblib/src/lib/alloc/object_set.cpp
vendored
6
deps/oblib/src/lib/alloc/object_set.cpp
vendored
@ -282,7 +282,6 @@ void ObjectSet::free_normal_object(AObject *obj)
|
||||
auto ctx_id = blk_mgr_->get_ctx_id();
|
||||
auto tenant_id = blk_mgr_->get_tenant_id();
|
||||
if (newobj->nobjs_ == cells_per_block_) {
|
||||
hold_bytes_ -= ablock_size_;
|
||||
normal_hold_bytes_ -= ablock_size_;
|
||||
free_block(newobj->block());
|
||||
} else if (OB_ISNULL(last_remainder_)) {
|
||||
@ -306,7 +305,7 @@ ABlock *ObjectSet::alloc_block(const uint64_t size, const ObMemAttr &attr)
|
||||
block->prev_ = block->next_ = block;
|
||||
blist_ = block;
|
||||
}
|
||||
hold_bytes_ += size;
|
||||
hold_bytes_ += block->hold();
|
||||
block->obj_set_ = this;
|
||||
block->ablock_size_ = ablock_size_;
|
||||
block->mem_context_ = reinterpret_cast<int64_t>(mem_context_);
|
||||
@ -320,6 +319,7 @@ void ObjectSet::free_block(ABlock *block)
|
||||
abort_unless(NULL != block);
|
||||
abort_unless(block->is_valid());
|
||||
|
||||
hold_bytes_ -= block->hold();
|
||||
if (block == blist_) {
|
||||
blist_ = blist_->next_;
|
||||
if (block == blist_) {
|
||||
@ -355,8 +355,6 @@ void ObjectSet::free_big_object(AObject *obj)
|
||||
abort_unless(NULL != obj->block());
|
||||
abort_unless(obj->is_valid());
|
||||
|
||||
hold_bytes_ -= obj->alloc_bytes_ + AOBJECT_META_SIZE;
|
||||
|
||||
free_block(obj->block());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user