Skip to content

Commit

Permalink
Refs #22841. Consider a mean message size of half the max message size.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany committed Feb 24, 2025
1 parent f99ecf0 commit 04f176e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,8 @@ bool SharedMemTransport::init(
{
return false;
}
uint32_t max_allocations = configuration_.segment_size() / configuration_.max_message_size();
if ((configuration_.segment_size() % configuration_.max_message_size()) != 0)
{
++max_allocations;
}
uint32_t mean_message_size = configuration_.max_message_size() / 2;
uint32_t max_allocations = configuration_.segment_size() / mean_message_size;
if (configuration_.port_queue_capacity() > max_allocations)
{
max_allocations = configuration_.port_queue_capacity();
Expand Down

0 comments on commit 04f176e

Please sign in to comment.