Skip to content

Memory management improvements #590

@wjwwood

Description

@wjwwood

This is a meta ticket to collect some related tasks that have been targeted for future releases and that are related to memory management within ROS 2 and it's various layers.

  • Expand usage of rcutils_allocator_t
    • rmw: all rmw functions which may allocate memory internally need to take an allocator so it can be passed down from the rcl functions which call it
    • rosidl for C types: all code generators (including rosidl_generator_c as well as middleware specific code generators) should be updated to take allocators where it makes sense (e.g. array initialization functions)
    • rosidl for C++ types: the std::allocator pattern is already in use, but it should be audited to make sure it's being used correctly
  • Provide mechanism to use memory allocated by the middleware (get a message loan from the middleware, fill it with data, use it to publish, return the loan)
  • Remove unnecessary copies and memory allocations in publish/take calls (more generally in calls made in "steady state" of typical nodes)
  • Audit documentation for declarations about dynamic memory usage
    • rcutils
    • rmw
    • rosidl
    • rcl

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions