← Back to team overview

yade-dev team mailing list archive

[Bug 1570679] Re: Memory leak during updating position of tetrapoly elements

 

In previous comment, I meant 
O.bodies[0].shape.setVertices(a[0],a[1],a[2],a[3])
O.bodies[0].shape.setVertices(a)
to be consistent with original bug report

-- 
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.
https://bugs.launchpad.net/bugs/1570679

Title:
  Memory leak during updating position of tetrapoly elements

Status in Yade:
  Fix Released

Bug description:
  There exists severe 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()

To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/1570679/+subscriptions


References