Signed-off-by: zihe.liu <ziheliu1024@gmail.com> Co-authored-by: zihe.liu <ziheliu1024@gmail.com>
This commit is contained in:
parent
1cf54d7670
commit
6bebdbac4d
|
|
@ -26,6 +26,7 @@
|
|||
#include "simd/simd.h"
|
||||
#include "types/logical_type_infra.h"
|
||||
#include "util/runtime_profile.h"
|
||||
#include "util/stack_util.h"
|
||||
|
||||
namespace starrocks {
|
||||
|
||||
|
|
@ -483,6 +484,15 @@ void JoinHashTable::_init_join_keys() {
|
|||
}
|
||||
|
||||
int64_t JoinHashTable::mem_usage() const {
|
||||
// Theoretically, `_table_items` may be a nullptr after a cancel, even though in practice we haven’t observed any
|
||||
// cases where `_table_items` was unexpectedly cleared or left uninitialized.
|
||||
// To prevent potential null pointer exceptions, we add a defensive check here.
|
||||
if (_table_items == nullptr) {
|
||||
LOG(WARNING) << "table_items is nullptr in mem_usage, stack:" << get_stack_trace();
|
||||
DCHECK(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t usage = 0;
|
||||
if (_table_items->build_chunk != nullptr) {
|
||||
usage += _table_items->build_chunk->memory_usage();
|
||||
|
|
|
|||
Loading…
Reference in New Issue