rclcpp icon indicating copy to clipboard operation
rclcpp copied to clipboard

[Galactic backport] Do not attempt to use void allocators for memory allocation

Open sykwer opened this issue 4 years ago • 1 comments

We need to fix the type of allocator passed to a publisher and a subscriber, otherwise, extra memory space is allocated at various parts of rcl. For instance, a memory area of size sizeof(rcutils_string_map_impl_t) * sizeof(MessageT) is allocated here.

This bug not only causes extra memory consumption, but also causes std::bad_alloc in the publisher (and subscriber) that handles the message type when a huge message (larger than a few hundred MB) such as static size array is defined.

backport #1657

Signed-off-by: Takahiro Ishikawa [email protected]

sykwer avatar Aug 24 '22 13:08 sykwer

@sykwer thanks for bringing this up, instead of having dedicated backport MR, can https://github.com/ros2/rclcpp/pull/1657 backport to foxy / galactic straightforward? let me try.

fujitatomoya avatar Aug 24 '22 18:08 fujitatomoya

Given that Galactic is now EOL, closing this.

clalancette avatar Dec 15 '22 13:12 clalancette