Memory leak with pygame.transform functions
Victor Freire, 2009-06-14 13:52:40 -0700
Created attachment 24 Code demonstrating the leak and the image used. When using the following pygame.transform functions: scale(), smoothscale() and flip(), memory leaks occur. Scaling a texture a hundred times per frame consumes a LOT of memory, rendering me unable to use such functions in my game. I've attached a rar with the code that causes this and the image used. Operating System: Windows XP SP3 Python version: 2.6.1 Pygame 1.8.1 (the package available at the download section)
illume, 2009-06-28 21:44:16 -0700
With pygame 1.9.0rc1, and python2.5.2 on OSX I can not reproduce this. Maybe it is a windows, or python2.6 specific bug, or perhaps it has been fixed. Are you able to try this out with a new pygame? Binaries here: http://thorbrian.com/pygame/builds.php
Victor Freire, 2009-06-30 18:30:25 -0700
I have been able to bypass this in my game by reusing the same surface, not creating a new temporary one for each loop iteration. I've tested this in 2.5.2 so it's not only in 2.6. I'll try the new pygame version when I get some spare time.
Victor Freire, 2009-06-30 18:45:11 -0700
Created attachment 25 Leak 'workaround' and another leak case In this .rar there is a 'workaround' for the leak and a sligthly different test case in which leaking also occurs. Tested with the original configuration.