The rigid body anim graph node crashes for us when used with a scaled up mesh.
This only happens when the player is in an area with a lot of actors.
The crash happens because the node tries to allocate to much memory (See the attached crash log).
Too much memory is allocated because the array of actors that it considers for the collision is too big with several hundreds if not thousands of actors.
Looking at the code it looks like that the map `FAnimNode_RigidBody::ComponentsInSim` is never shrunk.
The two functions that should do that, `PurgeExpiredWorldObjects()` and `ExpireWorldObjects()` have no code for PhysX.
Apologize for the delay in response. I followed your Reproduction Steps and was unable to experience the crash where it allocated too much memory. How many actors was the mesh colliding with, and are there any other steps that might be missing so I can better reproduce it?
Additionally are you able to reproduce this issue by importing this mesh (or similar) into a vanilla 4.27 project? If you can also provide that sample project so I can try to reproduce it that would be great. Thank you.
That makes sense. If you can work around for the moment then this all gets a lot easier when you are on UE5 since we have complete source and it is in active development.
`PxTransform` is 28 bytes and `PageBufferSize` is 65536.
So when there are more than 2340 transforms in ShapeSOA.LocalTMs (ImmediatePhysicsSimulation_PhysX.cpp:711), the game will crash.
You don’t need that many actors at once. Because the array is never cleared you only ever need to encounter that many total actors/components in the surrounding.
Hello, I am still unable to reproduce the crash still, but based off your findings and digging a bit into the PhysX code I am seeing how this could potentially blow up if you are not using Chaos, it looks like ComponentsInSim::PurgeExpiredWorldObjects is only purged when using Chaos Physics but not when using PhysX. I will escalate this to Epic as I don’t see a fix for this yet.