The following program leaks about 300 KB per second on my machine (Windows XP, Python 2.6.5, pyglet 1.1.4, NVIDIA Quadro FX 360M (but I can observe the same on an Intel 855GME)):
--8<-------------------------------------------------------------
import pyglet
w = pyglet.window.Window()
while not w.has_exit:
w.dispatch_events()
w.clear()
l = pyglet.text.Label("abc", font_size=w.height,
x=w.width/2, y=w.height/2,
anchor_x="center", anchor_y="center")
l.draw()
w.flip()
pyglet.clock.tick()
--8<-------------------------------------------------------------
I know I shouldn't be creating labels in the loop, but this test case
was extracted from a larger application that runs for several hours, and
creates a number of labels during its execution. Currently, the
application dies after 2 hours from memory exhaustion, when it should
run for 8 hours straight.
I have tried peeking into the implementation of Label, TextLayout,
_GlyphBox and Batch, but I have to admit that I got lost along the way.
I am going to try to run the test with a Python memory analyzer, to try
and find what kind of objects take up memory. In the meantime, can
anyone confirm the issue? Any ideas what could be the cause? Any
workarounds that I could try?
Thanks.
-- Remy
signature.asc
Description: OpenPGP digital signature
