Memory leakage while plotting in a loop
Issue Memory leakage while generating python matplotlib plots in a loop on MacOS system. I was using python 3.9 and MacOS Catalina. I was trying to generate lots of plots for my analysis. Idea was to create them in a loop: render plot save the output iterate further Simple example of the case:
1 2 3 4 5 6 7 |
import matplotlib.pyplot as plt for i in range(10000): fig = plt.figure(figsize=(25, 25)) plt.plot([1,2,3]) plt.savefig(f'temp.png') plt.close(fig) |
[…]
Read more