Skip to content

Commit

Permalink
Change default memory allocation policy and size of the queue (eclips…
Browse files Browse the repository at this point in the history
…e-zenoh#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
  • Loading branch information
Mallets authored Feb 3, 2025
1 parent 8bde691 commit e17de41
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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",
},
},
},
Expand Down
12 changes: 6 additions & 6 deletions commons/zenoh-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit e17de41

Please sign in to comment.