I was reading up on Python’s garbage collection module and it states that Python will not only use reference counting, but it will also run a garbage collection, which is suppose to find all things that become trapped in memory and can not be freed.
I thought Panda3D data can not be freed once it becomes trapped…?
I setup the garbage list to print all things collected but always got a list of Zero.
import gc
gc.set_debug(gc.DEBUG_LEAK);
#and I had this print out
print "Garb: "+str(gc.garbage);
I even tried invoking the collection manually, but can’t say that it made any difference.
gc.collect();
I’m starting to draw a conclusion that Panda3D will eventually raise in memory no matter what. I can see my memory going down on a dump and up on a load, but eventually it’ll go down less, which means it’ll slowly allocate more memory.
Sometimes memory stands still on a load and sometimes after creeping up, it’ll drop down a lot, but never at the all time low it once was originally. I understand that P3D will hold on to memory, but that’s holding on too tightly.
I’m only working on partical effects and creating and destroying instances. I’ve only been using Panda3D for a couple of months, so I don’t think I’ll give it up that fast.
I’m just worried that, if a user of an app I make with P3D runs it long enough and instances are created and destroyed over a few hours time, those little gains in memory will soon flood out memory and crash the app.
I wish there was a way to print out all references pointing to a particular instances when it’s created and then a final print out of references once it’s destroyed.
Although, if I have any references stopping a cleanup then I’ll be damned.
I’ve deleted every object,
actor,
attribute,
attribute pointing to tasks,
stopped all tasks,
collision nodes,
collision Handler attributes,
the attribute in base (base.cTrave, base.eTrave, etc),
any textures stored as attributes,
I’ve cleaned out any lists within an instance that contained a pointer to another created instance (by looping the list and deleting every sub instance and then deleting the list itself),
and I haven’t forgotten to call that self.ignoreAll first.
Local/unbound variables delete themsleves (the ones without the self parameter)
Did I leave out anything?