Skip to content
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

Memory black hole in matplotlib animation. #2797

Closed
ghost opened this issue Feb 7, 2014 · 6 comments
Closed

Memory black hole in matplotlib animation. #2797

ghost opened this issue Feb 7, 2014 · 6 comments

Comments

@ghost
Copy link

ghost commented Feb 7, 2014

System:

CPU: AMD A4-3300, two cores at 2.5Ghz.
Memory: 4Gb, two DIMM sticks at 2Gb each.

The issue:

When calculating the data for the animation, namely the call to animation.FuncAnimation(), the memory remains within expected bounds (around 200Mb for my problem). When running the animation, however, the memory (about the remaining 3.2Gb) fills within a few seconds, then completely fills the swap space (2.8Gb).

I have experienced this issue in Ubuntu 13.10, tested with Python versions 3.3.2 and 2.7.5. Matplotlib, in both cases, is version 1.2.1. Installed from the Ubuntu archives.

@tacaswell
Copy link
Member

can you include example code?

@mdboom
Copy link
Member

mdboom commented Feb 7, 2014

You may also want to try 1.3.x -- 1.2.1 isn't supported any longer, so it's very unlikely we would issue a fix.

@WeatherGod
Copy link
Member

The example code is going to be very important. Depending on how you
implemented your animation, new objects might be created at every frame and
never removed. The animation module itself does not deal with object
management unless you utilize one of the speciality animation types (like
ArtistAnimation) -- and even then, it is extremely light-handed in that
respect, so it can be easy to build a memory-consuming animation.

@ghost
Copy link
Author

ghost commented Feb 7, 2014

Hi everyone,

I am running some more tests right now (e.g. the original test was done in IPython notebook; who knows -- maybe that's the problem). I will update with code soon. Also, it seems others have encountered these problems (see here: http://stackoverflow.com/questions/19646520/memory-usage-for-matplotlib-animation).

@WeatherGod
Copy link
Member

IPython can exacerbate an already bad animation design because it tries to
keep all of the artists "in-scope". But, as far as I know, it can't
introduce a problem where one didn't exist already, only make it show up
faster.

@ghost
Copy link
Author

ghost commented Feb 7, 2014

OK, it was bad debugging methodology on my part! It is neither matplotlib problem nor IPython. I was using an IPython 'plugin' JSAnimation to embed animation into the IPython notebook. I think it is JSAnimation that is causing the problem. matplotlib works like a charm and is quite fast.

I am closing the issue. Thanks everyone for your comments!

@ghost ghost closed this as completed Feb 7, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants