Skip to content

Commit

Permalink
Don't include the current thread when doing ram waiting calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
hextraza authored Dec 16, 2023
1 parent 15d56d0 commit cf9ad7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/process/bam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ fn block_on_memory_headroom(num_consumers: usize) -> bool {

while start_time.elapsed() < WAIT_TIMEOUT {
let current_memory = ALLOCATOR.allocated();
let average_memory_per_thread = current_memory / num_consumers;
let average_memory_per_thread = current_memory / (num_consumers - 1);
let remaining_headroom = total_memory - current_memory;
let predicted_memory_use = (average_memory_per_thread as f64) * SAFETY_BUFFER;

Expand Down

0 comments on commit cf9ad7e

Please sign in to comment.