Skip to content

Commit e17de41

Browse files
authored
Change default memory allocation policy and size of the queue (#1751)
* Lazy allocation of batches in transmission pipeline * Add config support for lazy allocation of tx batches * Fix typos * Properly consider config parameters * Limit allocation when really needed * Remove unnecessary println * Default to 1 RX buffer * Change default memory allocation policy and size of queue
1 parent 8bde691 commit e17de41

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

DEFAULT_CONFIG.json5

+8-8
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,14 @@
440440
/// then amount of memory being allocated for each queue is SIZE_XXX * LINK_MTU.
441441
/// If qos is false, then only the DATA priority will be allocated.
442442
size: {
443-
control: 1,
444-
real_time: 1,
445-
interactive_high: 1,
446-
interactive_low: 1,
443+
control: 2,
444+
real_time: 2,
445+
interactive_high: 2,
446+
interactive_low: 2,
447447
data_high: 2,
448-
data: 4,
449-
data_low: 4,
450-
background: 4,
448+
data: 2,
449+
data_low: 2,
450+
background: 2,
451451
},
452452
/// Congestion occurs when the queue is empty (no available batch).
453453
congestion_control: {
@@ -479,7 +479,7 @@
479479
/// Mode for memory allocation of batches in the priority queues.
480480
/// - "init": batches are allocated at queue initialization time.
481481
/// - "lazy": batches are allocated when needed up to the maximum number of batches configured in the size configuration parameter.
482-
mode: "init",
482+
mode: "lazy",
483483
},
484484
},
485485
},

commons/zenoh-config/src/defaults.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ impl QueueSizeConf {
256256
impl Default for QueueSizeConf {
257257
fn default() -> Self {
258258
Self {
259-
control: 1,
260-
real_time: 1,
261-
interactive_low: 1,
262-
interactive_high: 1,
259+
control: 2,
260+
real_time: 2,
261+
interactive_low: 2,
262+
interactive_high: 2,
263263
data_high: 2,
264-
data: 4,
264+
data: 2,
265265
data_low: 2,
266-
background: 1,
266+
background: 2,
267267
}
268268
}
269269
}

commons/zenoh-config/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,8 @@ validated_struct::validator! {
629629
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
630630
#[serde(rename_all = "snake_case")]
631631
pub enum QueueAllocMode {
632-
#[default]
633632
Init,
633+
#[default]
634634
Lazy,
635635
}
636636

0 commit comments

Comments
 (0)