Garbage Collection issues in NetworkPostLateUpdate

I’m facing issues with Garbage Collection and I don’t know how to debug it.
Every once in a while there is a lag spike caused by the Garbage Collector.

Here is GC.Alloc called every frame.

Here is GC.Collect causing the lag spike.

Is there a way to find the code allocating the memory?

Do you have deep profiling enabled? If not I‘d try that first.

Thank you, deep profiling was helpful.
I don’t understand the cause of this issue but it doesn’t seem to be related to my code.

You found any sort of solution to this? I’ve created an empty project. And after couple enters into PlayMode game may go as low as to 10FPS or so.
Settings for NetworkManager
9234816--1290273--upload_2023-8-19_23-38-16.png

9234816--1290276--upload_2023-8-19_23-39-23.png

And the result is this is piling up.

For anyone that’s end up looking for it here is how I managed to resolve it:

NGO 1.5.2 and unity 2022.3.7f1 with incremental GC & reload domain on play mode enter.

1 Like