matplotlib/matplotlib — pull request #1919 by mdboom (2013-05-13 16:44:29+00:00)
Title: Issue warning if too many figures are open

Users often ask me why they are running out of memory when plotting in loops, and this is because they are not calling ``plt.close`` when using ``pyplot``. I wonder whether it might make sense to emit a warning above say 20 plots saying that the number of open figures has now exceeded 20, and that the user may want to close some to avoid running out of memory. I just made up the value of 20, but I was trying to think above what value it's unlikely the user deliberately has this many figures open. This could be an RC parameter so that users who do want to open 1000 figures (and have the RAM for it) can.