ANP-Granular / ParticleTracking

Library and GUI for tracking (rod-like) particles on camera images in 2D and 3D
https://particletracking.readthedocs.io/en/latest/
GNU General Public License v3.0
2 stars 2 forks source link

RAM usage buildup with plot updating (memory leak) #70

Open a-niem opened 1 year ago

a-niem commented 1 year ago

Describe the bug

The RAM used by the RodTracker application increases every time the plots in the 3D-Reconstruction tab are updated. It is expected that the used RAM increases the first time the plotting of the loaded dataset is performed but not, that it increases with every update of the plots. It appears, that the Figure objects are not correctly destroyed after they are removed from display in the GUI. In extreme cases this will lead to a crash of the application.

To Reproduce Steps to reproduce the behavior:

  1. Load a rod position dataset (from *.csv).
  2. Update the plots using the Update Plots button in the 3D-Reconstruction tab
  3. Change a setting in the 3D-Reconstruction tab that leads to a change in the plotted data, i.e. Start Frame, End Frame, or the ticked Particle Colors.
  4. Update the plots using the Update Plots button.
  5. Observe the currently used RAM increase (amount depends on the loaded dataset, for example ~30 MB per plot update).
  6. Repeat steps 3.-5.

Expected behavior

The used RAM should only fluctuate a little and even decrease when one or multiple plots are removed, or when the plotted frame range is decreased significantly.

Desktop:

a-niem commented 1 year ago

This has been addressed in 0a022a6f41dc98bfff82e9df427642624486e65f. Automatic plot updating has been disabled for now to avoid frequent application crashes.