Possible memory leak?

Hello,

can anyone explain why this code:


import bge

own = bge.logic.getCurrentController().owner
sce = bge.logic.getCurrentScene()

for x in range(0,10000):
    
    polygon = own.meshes[0].getPolygon(0)
    v1 = own.meshes[0].getVertex(0,polygon.v1) # <- this line to be precise

causes blender RAM usage to increase constantly? If you want to see it shining in all of its beauty… activate TRUE level triggering and set frequency to 0. That causes RAM usage to increase about 30 MB a second (more or less, just eyeballed by how many it increases from task manager). That RAM space is freed only after exiting blender.

blender 2.69 r60995

Off topic but, is there any other way to get local position and normal of polygon in some other way that calculating them from vertices of that polygon. KX_PolyProxy doesn’t have functions like getXYZ() ant getNormal(), at least thats not in bge python api.

The local position of a polygon Is the average of the vertex positions if you consider that the centre. The same can be done to find the normal, and there are some mathutils functions to help you.

With regards to the memory leak, gave you tried a buildbot version of blender, as some changes were made recently that fixed another vertex bug.
Sent from my Nexus 5 using Tapatalk

Sorry for confusion, I meant to say “in some other way than”, not “that”. I was already doing as you said.

Thank you for suggestion, I’ll give it a try. At least i now know I not responsible for that crazy memory consumption.