Memory grows unless calling collide(), advance(), fetchResults().

We don’t call the collide(), advance() or fetchResults() functions. We just create static and rigid actors and perform scene queries. In this case, memory usage continues to grow, even when calling flushSimulation(). Is there anything that can be done to reclaim this memory?


what configuration of PhysX are you using? Does this happen even with release libraries? It might be possible that PVD does capture scene query data.


I’m using PhysX 3.4. It happens in both debug and release, both with and without enabling PVD. I can see things like the transform cache continue to grow in size over time.

What you could try is to attach shapes with only PxShapeFlag::eSCENE_QUERY_SHAPE. Then calling simulate/fetchResults should be cheap to call and the memory should get released. Additionally while calling the simulate/fetchResults a new scene query tree is build over time if objects move in your scene otherwise the current tree for the dynamic scene will become unbalanced over time.

Additionally you can also disable the simulation on PxActor and removing those actors from simulation completely.