simLoadModel with regular API decreases performance: possible memory leak?

Typically: "How do I... ", "How can I... " questions
Post Reply
FrankVeen
Posts: 7
Joined: 15 Mar 2016, 16:01

simLoadModel with regular API decreases performance: possible memory leak?

Post by FrankVeen » 14 Feb 2017, 20:07

Hi Coppelia Robotics,

I am using a regular API plugin to construct robots from modular building blocks and I would like to load robotic modules using the simLoadModel() function. I am also running an evolutionary algorithm that loads specific modules as .ttm files to construct a robot. However, in the long run I can see the performance of an evolutionary run decreasing when using simLoadModel() (See illustration: http://imgur.com/Dx9XElw). When removing all objects and all models by calling simRemoveModel() I have the same problem. Making sure that I close the scene and afterwards load a scene every step still leads to the same problem. If I just construct the modules using simCreatePureShape() etc. I don't have this decrease in performance.

I do give the models that I load new parent objects and this is the only thing I can think of that might cause the issue.

Do you have any idea what is causing this decrease in performance? And do you have a solution/workaround?

The evolutionary algorithm works by (based on bubblerob plugin):
1) Starting the simulator:
1.1) Closing the current scene (simCloseScene)
1.2) Loading a specific scene (simLoadScene)
1.3) Constructing a robot based on a genome (using simLoadModel)
2) Handling the simulator: Simulating the robot until a specific time limit has been reached
3) Stopping the simulator: Deleting the robot and saving specific parameters.
4) Repeat from step 1 until evolutionary algorithm reaches a limit

Thanks in advance!

Cheers, Frank

coppelia
Site Admin
Posts: 7396
Joined: 14 Dec 2012, 00:25

Re: simLoadModel with regular API decreases performance: possible memory leak?

Post by coppelia » 14 Feb 2017, 20:47

Hello Frank,

this is probably linked to a bug we have in version V3.3.2 (and prior this). This should have been fixed for next release. You can probably see that you have the list of shape materials that grow and grow and grow. Can you confirm this?

Cheers

FrankVeen
Posts: 7
Joined: 15 Mar 2016, 16:01

Re: simLoadModel with regular API decreases performance: possible memory leak?

Post by FrankVeen » 15 Feb 2017, 00:17

Thanks for letting me know! You're right, the list of shape materials is increasing over time: Image

Cheers

Post Reply