Mobile Mesh - after removing from Space, never GC'd
Posted: Tue Feb 24, 2015 11:03 am
Hi there,
I have a procedurally generated outdoor scene, where I am dynamically creating and destroying a number of mobile mesh objects. I have noticed that they don't seem to be garbage collected, despite my removing them from the space, and I am fairly certain I am not retaining any references to them in my own code. I am reasonably certain this is the case, because when I remove the collision geometry altogether, and progress through the scene, memory usage is very stable; Entities and their associated render geometry which is no longer in the scene is definitely being disposed of correctly.
When, however, I add a corresponding mobile mesh to each of my game objects, and perform Space.Remove(mobileMesh) when they are no longer needed, memory usage continues to climb as I move through the world. It looks to me as though Bepu is retaining a reference to them somewhere internally, even though they've been removed.
Is this a known issue, or is it more likely I've missed a reference in my own code? Or is there other work required to dispose of the mobile mesh instances?
Thanks!
I have a procedurally generated outdoor scene, where I am dynamically creating and destroying a number of mobile mesh objects. I have noticed that they don't seem to be garbage collected, despite my removing them from the space, and I am fairly certain I am not retaining any references to them in my own code. I am reasonably certain this is the case, because when I remove the collision geometry altogether, and progress through the scene, memory usage is very stable; Entities and their associated render geometry which is no longer in the scene is definitely being disposed of correctly.
When, however, I add a corresponding mobile mesh to each of my game objects, and perform Space.Remove(mobileMesh) when they are no longer needed, memory usage continues to climb as I move through the world. It looks to me as though Bepu is retaining a reference to them somewhere internally, even though they've been removed.
Is this a known issue, or is it more likely I've missed a reference in my own code? Or is there other work required to dispose of the mobile mesh instances?
Thanks!