Open nmansard opened 1 year ago
I have been able to reproduce the issue. However, when counting the number of nodes allocated by increasing a counter in each constructor and decreasing it in the destructor, the total number of objects at the end of the test is 105. The problems does not come from nodes not being destroyed.
Any idea ?
Destruction might not be destructive enough. Valgrind could help track this.
I post this issue for future reference. The title sounds bad but I actually don't think it is so important as it does not correspond to a typical usage of Gepetto-Viewer.
When iteratively deleting nodes then re-creating them, we observed that the memory usage of Gepetto-viewer keep growing.
Gepetto-viewer is typically used in situations where we want to avoid re-loading the visual objects, so this situation is unlikely to happen. A minimal answer is to take care of raising the user awareness when writing an application where nodes are systematically deleted. A second level of answer could be to add automatic warning in Gepetto-viewer itself, when observing unusual node deletion (say after 1000 deletions, emit a warning to the console). Of course, ideally, this bug should be fixed.
Note that it was only tested with XYZaxis features, maybe simpler visual objects are not causing it.
with more details ...
The bug can be observed with the following code:
(you need to start gepetto-gui corba server first).
The memory raise is displayed on the following plot: (this plot can be reproduced with pmap using https://gitlab.laas.fr/-/snippets/17 and lanching
pmapnitor.py gepetto-gui
then the script above.