View Single Post
Old 06-25-2009, 09:29 AM
hosier hosier is offline
Join Date: Feb 2007
Posts: 31
Change model alpha and memory leak

In the project I'm working on, I change the alpha of a model so that another model can stand out when we want to focus on that. I never noticed it at first, but once I do that, the memory usage of winviz starts growing and I'm not sure if it ever stops. My program grew from 180M to over 800M before I finally quit it.

In trying to figure out the problem, I reduced it down to a simple load model and then change alpha when you hit the a key program, and have tried this with both a lightwave and 3DS model, getting the same results. My simple test program is:
import viz

# change view position if the lightwave model is used

#model = viz.add('test_object.lwo')
model = viz.add('learjet35a.3ds')

def mykeyboard(key):
	global model

	if key == 'a':

It starts out at about 21 to 22 MB, but as soon as you hit the a key to change the alpha, it starts climbing. It grew about 1M every minute.

At first I thought it was my lightwave model, but when I tried a 3DS model I've been playing around with, it did the same thing.

Has anybody seen this before? Should I be doing this differently? It it a bug somewhere?

Any help would be appreciated.

I've attached a zipfile that has the two models I've tried along with the above vizard script.


Attached Files
File Type: zip (528.8 KB, 974 views)
Reply With Quote