Good information, although I don't understand it.

The 'weeplot' image generator actually caches fonts, exactly for this
reason. Many years ago, we experienced memory leaks, due to PIL not
properly recycling font handles. So, in revision 8615d0f3, added over 7
years ago, we introduced the cache. So, either, for some reason, it isn't
working for default fonts, or the memory leak lies within some special
implementation that the default uses.

Are you using PIL or Pillow?

-tk

On Sun, Dec 1, 2019 at 1:43 PM Rich Bell <bellri...@gmail.com> wrote:

> This is not new information, but I thought it might help others seeing a
> steady increase in memory consumption.
> TL;DR
> I am seeing a memory leak when the imaging library default font is used.
> Ensuring that a font is specified for each label (top_label_font_path,
> unit_label_font_path, bottom_label_font_path, axis_label_font_path,
> rose_label_font_path) seems to have fixed it.
>
> Backgound:
> Running with:
> OS: Linux-4.19.49v6v7-aufs-armv7l-with-debian-9.6
> Python: 3.5.3 (default, Sep 27 2018, 17:25:39)
> [GCC 6.3.0 20170516]
> PIL/Pillow: 4.0.0
>
> I was seeing the following:
> [image: week]
>
> The following is a graph of memory size over the same time period.  It
> graphs the same weewx instance as above - no fonts specified for the images
> (base), an instance with the skin disabled (disabled), and one with the
> fonts specified (fontsall).
> [image: week3]
>
> Here is a plot of the RSS over the same time.
> [image: week3]
>
> Here are a few more data points that may or may not be of interest.
> "noimage" does not call plot.render() while render does, but does not save
> the image (image.save).
> Here is the memory size plot.
> [image: week4]
>
> And the RSS.
> [image: week4]
>
> - rich
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/fe7997e1-15d9-4f83-b338-44075df42ef1%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/fe7997e1-15d9-4f83-b338-44075df42ef1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEDD44foZ2L5bEsokk_RPg7MU-69QOuE8AOoejkB3yTL9w%40mail.gmail.com.

Reply via email to