From 0015353c16e8ce0c3d930c76f3f6939e09908121 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/design.md b/docs/design.md index 43ecdc7a..b58db924 100644 --- a/docs/design.md +++ b/docs/design.md @@ -434,3 +434,20 @@ 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 in host-to-host communication, or after transmission in inter-process +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`, serialization buffers are 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 roughly proportionate to the cache +size of a typical modern CPU.