Acoustics monitoring with huge memory leak
As reported by @aenzenhoefer, the acoustics scripts piles up the memory:
2020-04-14 17:42:14 ERROR ++ km3pipe.db: No data found at URL 'streamds/clbmap.txt?detoid=49'.
scripts/acoustics.py:312: 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 rcParamfigure.max_open_warning).
fig = plt.figure()
This caused sever issues on the offline server and needs to be fixed as soon as possible. The script is now suspended.
Take as an example one of the scripts of the km3mon
suite. The correct way to create a figure and an axis object is e.g. here: https://git.km3net.de/km3py/km3mon/-/blob/480f8f17daf56edd1b857a5038bfc2956f438f10/scripts/pmt_rates.py#L123 and avoid using plt
. Use it only for savefig
and cleaning up, as done here: https://git.km3net.de/km3py/km3mon/-/blob/480f8f17daf56edd1b857a5038bfc2956f438f10/scripts/pmt_rates.py#L148