Skip to content

Fix constantly increasing memory in std::list (backport #636)#648

Merged
ahcorde merged 1 commit intohumblefrom
mergify/bp/humble/pr-636
Feb 13, 2024
Merged

Fix constantly increasing memory in std::list (backport #636)#648
ahcorde merged 1 commit intohumblefrom
mergify/bp/humble/pr-636

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Feb 12, 2024

This is an automatic backport of pull request #636 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* Fix constantly increasing memory in std::list

When someone is constantly publishing with the same tf2 timestamp
(application error, I know), the storage_ of the tf2::TimeCache grows
unbounded causing system-wide memory leaks. In a ROS system, each tf2
Listener will spawn one of these TimeCache objects and thus, all ROS
nodes that have any sort of tf2 listener will slowly start allocating
more and more memory

And also fixed the situation where two different tf2 needs to be
introduced at the same timestamp.

Since the tests were failing I realized that I had to dive a bit deeper
into the simple solution. And extend a bit the TransformStorage clase to
be comparable, now instead of just looking to the timestamps, the
implementation avoids inserting duplicates in the buffer.

If for some reason, someone is publishing a different Transfrom
(xyz,rpy) at the same timestamp. Well, that case is not being captured
now, but I'd say that's another problem

Signed-off-by: Ignacio Vizzo <ignaciovizzo@gmail.com>
(cherry picked from commit 1621942)
@clalancette
Copy link
Copy Markdown
Contributor

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit bda8c49 into humble Feb 13, 2024
@delete-merged-branch delete-merged-branch bot deleted the mergify/bp/humble/pr-636 branch February 13, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants