![](https://secure.gravatar.com/avatar/565476157eb3895a9c928ffce26d988d.jpg?s=120&d=mm&r=g)
Hi Yue Wang, Yue Wang wrote:
myfont = load_font('arial.ttf') myfont = load_font('arial.ttf') } and I can see the memory usage may ebb and flow, but actually it is leaking memory.
I also see a non-trivila leak (somewhere inside the fontforge library). I will investigate further next week, it is not that massive. I get this result for your input file, with 500 arial.ttfs (ArialMT version 3.0, 367112 bytes): ==8819== LEAK SUMMARY: ==8819== definitely lost: 16,965,191 bytes in 707,541 blocks. ==8819== possibly lost: 1,128 bytes in 22 blocks. ==8819== still reachable: 202,135,427 bytes in 81,127 blocks. ==8819== suppressed: 0 bytes in 0 blocks. ==8819== Rerun with --leak-check=full to see details of leaked memory. So some 32kb per font. Noticeable, but not enormous. The growth in 'top' is probably caused more by memory fragmentation than by this leak. Best wishes, Taco