panoptes/POCS

Memory leak from focuser._autofocus with plots

danjampro opened this issue · 0 comments

If an autofocus is run with make_plots=True, the resulting plot does not release its allocated memory at the end of the sequence. This has been causing out of memory errors for the Huntsman raspberry pi systems.

The code:

Suggested change (tested on hardware):

import gc

plt.cla()
plt.clf()
plt.close(fig)
gc.collect()