Step and build physics world generating a TON of garbage

Hardly anything in the scene. Nothing in the scene is moving.


This only gets exaggerated as things start moving and engaging with physics. But this is at complete rest. I’m not sure what Dispose Sentinel does, but its being used a lot, and generating a crap ton of garbage which causes big lag spikes.

Dispose sentinel is part of the safety system which is stripped out in builds. There is little point to profiling memory in editor, do it in a build.

I haven’t been able to get it to build successfully. Subscenes seem to break everything for builds.

This is not well documented but subscenes can’t be built using the old build pipeline. They need to be built use the new SBP (and platforms)

https://docs.unity3d.com/Packages/com.unity.scriptablebuildpipeline@1.6/manual/index.html
https://docs.unity3d.com/Packages/com.unity.platforms@0.6/manual/index.html
https://docs.unity3d.com/Packages/com.unity.platforms.windows@0.6/manual/index.html

Also, although @tertle is correct and profiling the build, you can get better results in the editor if you disable safety checks, jobs debugger and leak detection.

1 Like