New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matplotlib runs out of memory #20067
Comments
Running this on master in ipython, this finishes correctly and I don't see an increase in mem usage over time. Please try stripping down your example to the minimum that is needed to reproduce the crash. |
@timhoffm This issue is particularly caused on google colab. |
This is related to the inline backend. Can be reproduced locally in a jupyter notebook using
The memory leak can be avoided by explicitly switching to the agg backend:
|
I think that is ipython's backend? From our point of view its just an agg buffer.... |
Indeed the inline backend is under ipython's control. So the issue should be posted to https://github.com/ipython/ipython. |
There probably is some way to flush the python output every step, but then you will have hundreds of plots on your page. I'll close here because I don't think there is anything matplotlib can do here. |
cross ref: ipython/ipython#7270 |
ipython/ipython#7270 (comment) <- pretty sure this is the correct explanation. |
@timhoffm @jklymak @tacaswell Thanks for looking into it and resolving the issue. Solution works perfectly. |
Bug report
Bug summary
Code runs out of the memory, uses all of the available RAM, causes notebook crash on google colab.
Code for reproduction
Actual outcome
Expected outcome
Matplotlib version
import matplotlib; print(matplotlib.__version__)
): 3.2.2 / 3.4.1 (tried on both)print(matplotlib.get_backend())
): module://ipykernel.pylab.backend_inlineThe text was updated successfully, but these errors were encountered: