On Sunday, June 1, 2014 4:07:30 AM UTC-4, Juan J. Martínez wrote:
>
>
> Not sure you need to create a new batch as you're already deleting the 
> vertex list with vl.delete() and that is removing it from the batch. 

I guess you're doing it to prove the leak. 


Yes, the example was just to demonstrate the problem. In the project I'm 
working on, I use a batch for each sector of the map, which is supposed to 
be released when the sector goes out of range. (Having multiple batches 
instead of one gave a bit of a performance bump on older hardware because I 
can simply not draw batches that are outside of the frustum.) But I noticed 
that this wasn't freeing up memory. My workaround is to save the old 
batches and reuse them, which seems to solve the problem.

 

> I'm not sure but printing 
> gc.garbage could help to see if there are uncollected objects. 
>

I've put some of the output from gc.set_debug(...) in a comment on the 
gist: https://gist.github.com/spillz/088b7b5ec0ddc4f16eb2
The contents of gc.garbage was huge. (It is emptied after a call to 
gc.collect())
 

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to