Skip to content

Probable Memory Leak (?) #3141

@lomcin

Description

@lomcin

Environment

  • OS Version: Ubuntu 24.04.3 LTS
  • Source or binary build? Binary, Gazebo Sim, version 8.9.0
I have detected a probable memory leak during a development of a plugin for Gazebo.

I have created a Gazebo Plugin to demonstrate the probable memory leak when creating and removing entities using the Entity Component Manager. I noticed an increase in memory usage when I had more complex entities, and entities with child entities. This feature is important for my plugin. Therefore, I created this example to isolate the problem.

Description

  • Expected behavior: Memory usage to be constant by the process.
  • Actual behavior: Memory usage increased by the process.

Steps to reproduce

  1. Use the example source code (https://github.com/lomcin/gz_entity_create_plugin_ws) for a plugin that only creates and removes entities in PreUpdate method.
  2. Read the plugin code (entity_create_plugin), then Run the quickstart command.
  3. Check the memory usage of gz sim gui, it should be increasing in case of memory leak after 30k iterations.

Output

I did run the code until the entity id was 9218205, just to demonstrate the issue.

As you can see in the first print, I have just started the Gazebo, and I'm watching the memory usage of its processes. 191.1 MB for the gz sim gui.

Image

Then, after 5h and 10 minutes I've got this (345.4 MB for the gz sim gui):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions