SwatPhonLab / UltraTrace

A Free/Open-Source tool for manual annotation of Ultrasound Tongue Imaging data.
GNU General Public License v3.0
10 stars 5 forks source link

frames eat memory #148

Open jonorthwash opened 3 years ago

jonorthwash commented 3 years ago
UltraTrace/ultratrace/util/framereader.py:199: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig = plt.figure()

Not sure this is necessarily a bad thing? How do we want to proceed?

jonorthwash commented 3 years ago

It seems it can be only a few frames loaded several times each that calls this up, so perhaps there's an actual bug here.

mr-martian commented 3 years ago

Is this noticeably impacting memory? Or is it just a warning? close() is called on the figure later in the same function, so if I remember correctly, I tried to get rid of the warning but was unsuccessful.

jonorthwash commented 3 years ago

I'm not sure. But it does seem to open single images multiple times? Maybe this is because they're closed when another image is displayed?

mr-martian commented 3 years ago

This is for ULT and what's supposed to happen is it opens a matplotlib figure, generates the image, copies it to png for display, and then closes the figure immediately. The problem is that for some reason, the figure isn't closing.