← Back to team overview

yade-users team mailing list archive

[Question #290947]: Memory leak during updating position of tetrapoly elements

 

New question #290947 on Yade:
https://answers.launchpad.net/yade/+question/290947

There exists sever memory leaking problem when using intermediate variables to update positions of tetraPoly in a loop:

running the code, the memory will keep leaking:
#
a = [[0,0,0],[0,0,1],[0,1,0],[1,0,0]]
O.bodies.append(yade.utils.tetraPoly(a))
for i in range(1000000):
    b = [[0,0,0],[0,0,1],[0,1,0],[i+2,0,0]]
    O.bodies[0].shape.setVertices(b)
    O.bodies[0].state.ori = O.bodies[0].shape.GetOri()
    O.bodies[0].state.pos = O.bodies[0].shape.GetCentroid()
    O.bodies[0].state.mass = O.bodies[0].mat.density * O.bodies[0].shape.GetVolume()
    O.bodies[0].state.inertia = O.bodies[0].mat.density * O.bodies[0].shape.GetInertia()


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.