Memory leak from focuser._autofocus with plots
danjampro opened this issue · 0 comments
danjampro commented
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:
POCS/src/panoptes/pocs/focuser/focuser.py
Line 562 in dc330ac
Suggested change (tested on hardware):
import gc
plt.cla()
plt.clf()
plt.close(fig)
gc.collect()