From 379365121090eda03d164bb334b317bf659293ce Mon Sep 17 00:00:00 2001 From: Luca Cominardi Date: Mon, 3 Feb 2025 10:31:01 +0100 Subject: [PATCH] Change default memory allocation policy and size of queue --- DEFAULT_CONFIG.json5 | 16 ++++++++-------- commons/zenoh-config/src/defaults.rs | 12 ++++++------ commons/zenoh-config/src/lib.rs | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/DEFAULT_CONFIG.json5 b/DEFAULT_CONFIG.json5 index 001c097b2..f174a5cd8 100644 --- a/DEFAULT_CONFIG.json5 +++ b/DEFAULT_CONFIG.json5 @@ -440,14 +440,14 @@ /// then amount of memory being allocated for each queue is SIZE_XXX * LINK_MTU. /// If qos is false, then only the DATA priority will be allocated. size: { - control: 1, - real_time: 1, - interactive_high: 1, - interactive_low: 1, + control: 2, + real_time: 2, + interactive_high: 2, + interactive_low: 2, data_high: 2, - data: 4, - data_low: 4, - background: 4, + data: 2, + data_low: 2, + background: 2, }, /// Congestion occurs when the queue is empty (no available batch). congestion_control: { @@ -479,7 +479,7 @@ /// Mode for memory allocation of batches in the priority queues. /// - "init": batches are allocated at queue initialization time. /// - "lazy": batches are allocated when needed up to the maximum number of batches configured in the size configuration parameter. - mode: "init", + mode: "lazy", }, }, }, diff --git a/commons/zenoh-config/src/defaults.rs b/commons/zenoh-config/src/defaults.rs index 190cfd50f..4eda0d051 100644 --- a/commons/zenoh-config/src/defaults.rs +++ b/commons/zenoh-config/src/defaults.rs @@ -256,14 +256,14 @@ impl QueueSizeConf { impl Default for QueueSizeConf { fn default() -> Self { Self { - control: 1, - real_time: 1, - interactive_low: 1, - interactive_high: 1, + control: 2, + real_time: 2, + interactive_low: 2, + interactive_high: 2, data_high: 2, - data: 4, + data: 2, data_low: 2, - background: 1, + background: 2, } } } diff --git a/commons/zenoh-config/src/lib.rs b/commons/zenoh-config/src/lib.rs index e359415a2..34e6cba3c 100644 --- a/commons/zenoh-config/src/lib.rs +++ b/commons/zenoh-config/src/lib.rs @@ -629,8 +629,8 @@ validated_struct::validator! { #[derive(Default, Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(rename_all = "snake_case")] pub enum QueueAllocMode { - #[default] Init, + #[default] Lazy, }