File tree Expand file tree Collapse file tree
datafusion/physical-plan/src/joins/grace_hash_join Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ use std::any::Any;
4242use std:: fmt;
4343use std:: fmt:: Formatter ;
4444use std:: mem:: size_of;
45- use std:: sync:: { Arc , OnceLock } ;
45+ use std:: sync:: Arc ;
4646
4747use arrow:: array:: UInt32Array ;
4848use arrow:: array:: { Array , StringViewArray } ;
@@ -632,6 +632,21 @@ impl ExecutionPlan for GraceHashJoinExec {
632632
633633 let join_metrics = Arc :: new ( BuildProbeJoinMetrics :: new ( partition, & self . metrics ) ) ;
634634
635+ // Debug: log pool usage at start of GHJ execute to diagnose out-of-memory conditions.
636+ let pool = context. memory_pool ( ) ;
637+ let reserved_now = pool. reserved ( ) ;
638+ let limit_msg = match pool. memory_limit ( ) {
639+ MemoryLimit :: Finite ( l) => human_readable_size ( l) ,
640+ MemoryLimit :: Infinite => "inf" . to_string ( ) ,
641+ MemoryLimit :: Unknown => "unknown" . to_string ( ) ,
642+ } ;
643+ debug ! (
644+ "Grace hash join execute partition {} pool reserved={}, limit={}" ,
645+ partition,
646+ human_readable_size( reserved_now) ,
647+ limit_msg
648+ ) ;
649+
635650 let left = self . left . execute ( partition, Arc :: clone ( & context) ) ?;
636651 let left_schema = Arc :: clone ( & self . left . schema ( ) ) ;
637652 let on_left = self
You can’t perform that action at this time.
0 commit comments