[ODE] Re: memory leak
Denes Nagymathe
denes at invictus.hu
Wed Sep 14 16:48:34 MST 2005
Hi,
There's some thrust in what you say. :o)
It depends on how you use ODE. In my case, i've changed the way contacts are
handled: my collision detection makes good use of coherence, and as a part
of it, i skip coll.det. for disabled bodies (which is pretty useful for the
usual in-game scenario), but keep their contacts in case they'd activated
again. This way i can have lots of inactive bodies laying around and still
consuming almost zero time as i don't delete all contacts and re-detect all
of them in each step.
But this approach has the drawback that i has to take care about these
contacts; either by finding them before i destroy the body, or letting ODE
clean up after me... :o)
So you're right, it can really be done without changing dBodyDestroy.
Denes
>
> I think the theory is that anything you create, you should delete. The
> thing with joints is that they often have two bodies, so trying to
> implement some kind of reference counting would be pretty messy, and
> still preclude joint re-use in some usage scenarios.
>
> So, I'd say your program has a leak of ODE objects, rather than ODE.
>
More information about the ODE
mailing list