From e7f140c948f2aeb5cdb3d84f2d0b33d09310a6c5 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Fri, 3 Jan 2025 14:34:48 +0000 Subject: [PATCH] Document `RMW_ZENOH_BUFFER_POOL_MAX_SIZE_BYTES` --- docs/design.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/design.md b/docs/design.md index 43ecdc7a..5ea6748b 100644 --- a/docs/design.md +++ b/docs/design.md @@ -434,3 +434,16 @@ Thus, there is no direct implementation of actions in `rmw_zenoh_cpp`. ## Security TBD + +## Environment variables + +### `RMW_ZENOH_BUFFER_POOL_MAX_SIZE_BYTES` + +The RMW recycles serialization buffers on transmission using a buffer pool with bounded memory +usage. These buffers are returned to the pool — without being deallocated — once they cross the +network boundary during host-to-host communication, or upon being consumed by subscriptions in +intra-process communication, etc. When the total size of the allocated buffers within the pool +exceeds `RMW_ZENOH_BUFFER_POOL_MAX_SIZE_BYTES`, then the serialization buffer is allocated using the +system allocator and moved to Zenoh; no recyling is performed in this case to prevent the buffer +pool from growing uncontrollably. The default value of `RMW_ZENOH_BUFFER_POOL_MAX_SIZE_BYTES` is 16 +MiB, thus roughly proportionate to the cache size of a typical modern CPU.