[Matplotlib-users] Problem of memory leak using FigureCanvasTkAgg

Benjamin Root ben.v.root at gmail.com
Thu Oct 19 10:32:35 EDT 2017


Did the rate of memory leak change?

On Thu, Oct 19, 2017 at 10:26 AM, GARCIA PIERRE SIMON p0904379 <
pierre.garcia at etu.univ-lyon1.fr> wrote:

> Thank you for your answer but I updated MPL to 2.1.0 and the memory leak
> is still there. Also, I skipped entirely pyplot and the result is strictly
> the same.
>
>
> Pierre
> ------------------------------
> *De :* Benjamin Root <ben.v.root at gmail.com>
> *Envoyé :* lundi 7 août 2017 19:27
> *À :* Thomas Caswell
> *Cc :* GARCIA PIERRE SIMON p0904379; matplotlib-users at python.org
> *Objet :* Re: [Matplotlib-users] Problem of memory leak using
> FigureCanvasTkAgg
>
> The stackoverflow posting notes that mpl v1.1.1 was used, which is 5 years
> old. I am pretty sure we have made a lot of memory leak fixes since then. I
> noted as such on SO.
>
> Ben Root
>
> On Sat, Aug 5, 2017 at 7:48 PM, Thomas Caswell <tcaswell at gmail.com> wrote:
>
>> It is likely there things are not being garbage collected due to either a
>> missed reference surviving or the circular references between the various
>> objects is delaying gc from collecting them (I do not recall the details
>> exactly off the top of my head, but running gc manually with more
>> generations may help).
>>
>> However, if you are embedding in a GUI you are probably better off just
>> doing the embedding directly (and skipping `pyplot` entirely, see
>> https://matplotlib.org/examples/user_interfaces/embedding_in_tk.html ).
>> Re-using the Figures / Axes / Artists to update the data (rather than
>> starting from scratch every time) may also prevent the memory leaks _and_
>> give you a performance boost.
>>
>> Please subscribe to the list so that you can post without moderation.
>>
>> Tom
>>
>> On Sat, Aug 5, 2017 at 12:36 PM GARCIA PIERRE SIMON p0904379 <
>> pierre.garcia at etu.univ-lyon1.fr> wrote:
>>
>>> Hello,
>>>
>>> I'm PhD student in Bioinformatic and I'm working on a project using
>>> matplotlib and Tkinter but I've got a big problem of memory leak using
>>> these modules. I'll be very grateful if you could help me to solve this
>>> problem. Here is the link explaining what happends, with a reduced script:
>>> http://stackoverflow.com/questions/43097378/matplotlib-vs-
>>> tkinter-memory-leak-using-figurecanvastkagg
>>>
>>> Thank you in advance,
>>>
>>>
>>> Sincerly,
>>>
>>>
>>>
>>>
>>> Pierre Garcia, PhD Student
>>> ---------
>>> Bases Moléculaires et Structurales des Systèmes infectieux-UMR5086
>>> Institut de Biologie et Chimie des Protéines
>>> 7 passage du Vercors
>>> <https://maps.google.com/?q=7+passage+du+Vercors&entry=gmail&source=g>
>>> 69 367 Lyon cedex 07
>>> ---------
>>> Laboratoire de Biométrie et Biologie Evolutive-UMR5558
>>> UCBL Lyon 1 -Bât. Grégory Mendel
>>> 43 bd du 11 novembre 1918
>>> <https://maps.google.com/?q=43+bd+du+11+novembre+1918&entry=gmail&source=g>
>>> 69622 VILLEURBANNE cedex
>>>
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Matplotlib-users at python.org
>>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>>
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20171019/cdc40a16/attachment.html>


More information about the Matplotlib-users mailing list