From 8ecb726683bca6a2e2c837db8c187ddbe39554f6 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 3 Dec 2024 15:49:11 +0100 Subject: [PATCH] Fix the minimun BBQueue channel threshold --- crates/milli/src/update/new/indexer/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/milli/src/update/new/indexer/mod.rs b/crates/milli/src/update/new/indexer/mod.rs index 7262c65cb..383823de1 100644 --- a/crates/milli/src/update/new/indexer/mod.rs +++ b/crates/milli/src/update/new/indexer/mod.rs @@ -86,9 +86,9 @@ where (grenad_parameters, 2 * minimum_capacity), // 100 MiB by thread by default |max_memory| { // 2% of the indexing memory - let total_bbbuffer_capacity = (max_memory / 100 / 2).min(minimum_capacity); + let total_bbbuffer_capacity = (max_memory / 100 / 2).max(minimum_capacity); let new_grenad_parameters = GrenadParameters { - max_memory: Some(max_memory - total_bbbuffer_capacity), + max_memory: Some(max_memory.saturating_sub(total_bbbuffer_capacity)), ..grenad_parameters }; (new_grenad_parameters, total_bbbuffer_capacity)