[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Memory hunger...
Hi,
A few hours ago I found a strange behaviour while using OpenGL in
pygame. Whenever I read a value using: "value =
glGetFloatv(GL_MODELVIEW_MATRIX)" the value was not cleaned from memory.
Initially I thought that it was a problem with the evil nVidia blob
driver, but when I switched to the xorg-x11 implementation using the nv
driver (without DRI), I experienced the same problem.
When running the program bellow on a Radeon 9250 using the latest driver
from the Xorg tree there are no problems what so ever (with DRI), and
the same result is obtained by running it on a cheap laptop with a SIS
661/741/760/761 chipset, again using the free software drivers.
Running the program bellow only takes twenty or so seconds to eat all my
available memory, 350 MB)
#!/usr/bin/python
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
def main():
pygame.init()
pygame.display.set_mode((800,600), pygame.OPENGL|
pygame.DOUBLEBUF)
glClearColor(1.0, 0.0, 0.0, 1.0)
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
done = False
while not done:
for i in range(0,50000):
modelview_matrix =
glGetFloatv(GL_MODELVIEW_MATRIX)
pygame.display.flip()
eventlist = pygame.event.get()
for event in eventlist:
if event.type == QUIT or event.type == KEYDOWN
and event.key == K_ESCAPE:
done = True
if __name__ == '__main__':
main()