Skip to content

Commit

Permalink
fix: check if global memory is negative (#14733)
Browse files Browse the repository at this point in the history
  • Loading branch information
xudong963 authored Feb 26, 2024
1 parent 57297a5 commit 16b105e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ impl BuildSpillState {
}

// Check if global memory usage exceeds the threshold.
let global_used = GLOBAL_MEM_STAT.get_memory_usage();
let mut global_used = GLOBAL_MEM_STAT.get_memory_usage();
// `global_used` may be negative at the beginning of starting query.
if global_used < 0 {
global_used = 0;
}
let byte = Byte::from_unit(global_used as f64, ByteUnit::B).unwrap();
let total_gb = byte.get_appropriate_unit(false).format(3);
let spill_threshold = self
Expand Down

0 comments on commit 16b105e

Please sign in to comment.