OK, so there is clearly a leak in the text rendering algorithm on Centos 7.
That narrows things down, but still leaves a heck of a lot of territory.

Looking through the Pillow change file
<https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst>, there
are lots of references to fixing memory leaks since your version (2.0.0)
was published. As yours is getting quite old (3 1/2 years), you could try
just upgrading to the current V3.3.1. Maybe we'd get lucky.

-tk


On Sat, Sep 10, 2016 at 5:25 AM, Allan <weewx2...@warpspeed.dyndns.dk>
wrote:

> Den 10-09-2016 kl. 00:51 skrev Thomas Keffer:
>
>> The problem is not likely to be loading the fonts (which are already
>> cached), but in their rendering.
>>
>> Here's a little program that loads the font only once, but renders
>> "hello world" 2500 times, then shows the result. It prints out the total
>> memory before and after the rendering. Play with different fonts and see
>> if you can discover anything. I think 2,500 renderings will be enough to
>> reveal something, but you may have to adjust.
>>
>> It also shows the results. If you're not running under a GUI, you should
>> comment out the last line in the program.
>>
>
> I use KDE.
>
> The first run resulted in an error - it seems it needed the full path to
> the font. after fixing that (on Centos 7):
>
> *** BEFORE RENDERING ***
> size=     147.1 MB
> resident= 5.4 MB
> share=    2.2 MB
>
> *** AFTER RENDERING ***
> size=     163.5 MB
> resident= 21.8 MB
> share=    2.6 MB
>
>
> Then I increased the x and y values to 5000:
>
> ~/Billeder>python imageleak1.py
> *** BEFORE RENDERING ***
> size=     147.1 MB
> resident= 5.4 MB
> share=    2.2 MB
>
> *** AFTER RENDERING ***
> size=     1659.2 MB
> resident= 1517.6 MB
> share=    2.6 MB
>
>
> Retried the last one on Fedora 24:
>
> *** BEFORE RENDERING ***
> size= 173.1 MB
> resident= 8.9 MB
> share= 4.9 MB
>
> *** AFTER RENDERING ***
> size= 174.4 MB
> resident= 10.5 MB
> share= 5.2 MB
>
>
>
>   Allan.
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to