unregister fragment mem tracker in close() (#3286)
ref https://github.com/apache/incubator-doris/issues/3273 P.S.614a76beea/be/src/runtime/plan_fragment_executor.cpp (L559-L562)I think this piece of code is useless. This `_mem_tracker` in `PlanFragmentExecutor` is set as fragment_mem_tracker of `RuntimeState`. **direct use** We use it in these code, when rowbatch reset, mem tracker's consumption will be released.7eab12a40e/be/src/exec/olap_rewrite_node.cpp (L57-L58)839ec45197/be/src/exec/olap_scan_node.cpp (L1217-L1218)**other usage** e.g.6c33f80544/be/src/exec/olap_scanner.cpp (L245)won't consume the fragment mem tracker. We don't need to worry about the fragment mem tracker consumption is not zero when we want to destroy it. Or we can add a consumption check before we close the mem tracker?
This commit is contained in:
@ -65,6 +65,11 @@ PlanFragmentExecutor::~PlanFragmentExecutor() {
|
||||
// }
|
||||
// at this point, the report thread should have been stopped
|
||||
DCHECK(!_report_thread_active);
|
||||
|
||||
// fragment mem tracker needs unregister
|
||||
if (_mem_tracker.get() != nullptr) {
|
||||
_mem_tracker->unregister_from_parent();
|
||||
}
|
||||
}
|
||||
|
||||
Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request) {
|
||||
|
||||
Reference in New Issue
Block a user