Fix memory of DecoderCtx not free as expected

This commit is contained in:
obdev
2024-02-06 21:59:26 +00:00
committed by ob-robot
parent 0606bc2895
commit d39cfe867f
2 changed files with 8 additions and 4 deletions

View File

@ -115,7 +115,11 @@ public:
const int64_t row_cap,
storage::ObGroupByCell &group_by_cell) const;
OB_INLINE void reserve_reader_memory(bool reserve)
{ reader_->reserve_reader_memory(reserve); }
{
if (nullptr != reader_) {
reader_->reserve_reader_memory(reserve);
}
}
int64_t get_current_pos() const
{ return current_; }
VIRTUAL_TO_STRING_KV(K_(can_ignore_multi_version));

View File

@ -548,6 +548,9 @@ int ObCGRowScanner::get_next_rows(uint64_t &count, const uint64_t capacity, cons
} else {
int64_t batch_size = MIN(iter_param_->op_->get_batch_size(), capacity);
prefetcher_.recycle_block_data();
if (nullptr != micro_scanner_) {
micro_scanner_->reserve_reader_memory(false);
}
while (OB_SUCC(ret) && count < batch_size) {
if (OB_FAIL(prefetcher_.prefetch())) {
LOG_WARN("Fail to prefetch micro block", K(ret), K_(prefetcher));
@ -567,9 +570,6 @@ int ObCGRowScanner::get_next_rows(uint64_t &count, const uint64_t capacity, cons
}
}
}
if (OB_SUCC(ret) && nullptr != micro_scanner_) {
micro_scanner_->reserve_reader_memory(false);
}
}
if (count > 0 && datum_infos_.count() > 0) {
LOG_TRACE("[COLUMNSTORE] get next rows in cg", K(ret), K_(query_index_range), K_(current), K(count),